LinuxCommandLibrary

gh-pr-create

Create new pull requests on GitHub

TLDR

Create PR interactively

$ gh pr create
copy
Create with title and body
$ gh pr create -t "[title]" -b "[body]"
copy
Create as draft
$ gh pr create --draft -t "[title]"
copy
Create with reviewers
$ gh pr create -t "[title]" -r [reviewer1],[reviewer2]
copy
Create to specific base branch
$ gh pr create --base [main] --head [feature]
copy
Create and fill from commits
$ gh pr create --fill
copy
Open in browser to create
$ gh pr create -w
copy

SYNOPSIS

gh pr create [options]

DESCRIPTION

gh pr create creates pull requests on GitHub from the command line. It streamlines the PR creation workflow by detecting the current branch context and offering multiple input modes.
When run without arguments, the command prompts interactively for title, body, and metadata. The --fill flag auto-populates the title from the first commit message and the body from all commit messages since branching. Draft PRs (--draft) allow pushing work-in-progress changes for early feedback without formal review requests.

PARAMETERS

-t, --title title

PR title.
-b, --body body
PR body.
-d, --draft
Create as draft.
-r, --reviewer users
Request reviewers.
-a, --assignee users
Assign users.
-l, --label labels
Add labels.
--base branch
Base branch.
--head branch
Head branch.
--fill
Fill from commits.
-w, --web
Open in browser.
-R, --repo owner/repo
Repository.

SEE ALSO

gh-pr(1), gh-pr-list(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community