gh pr create

Create a pull request


Create a pull request

gh pr create [flags]


$ gh pr create --title "The bug is fixed" --body "Everything works again"
$ gh issue create --label "bug,help wanted"
$ gh issue create --label bug --label "help wanted"
$ gh pr create --reviewer monalisa,hubot
$ gh pr create --project "Roadmap"
$ gh pr create --base develop


  -a, --assignee login   Assign people by their login
  -B, --base string      The branch into which you want your code merged
  -b, --body string      Supply a body. Will prompt for one otherwise.
  -d, --draft            Mark pull request as a draft
  -f, --fill             Do not prompt for title/body and just use commit info
  -l, --label name       Add labels by name
  -m, --milestone name   Add the pull request to a milestone by name
  -p, --project name     Add the pull request to projects by name
  -r, --reviewer login   Request reviews from people by their login
  -t, --title string     Supply a title. Will prompt for one otherwise.
  -w, --web              Open the web browser to create a pull request

Options inherited from parent commands

      --help              Show help for command
  -R, --repo OWNER/REPO   Select another repository using the OWNER/REPO format

Examples in use


# Create a pull request interactively
~/Projects/my-project$ gh pr create
Creating pull request for feature-branch into master in owner/repo
? Title My new pull request
? Body [(e) to launch nano, enter to skip]

With flags

# Create a pull request using flags
~/Projects/my-project$ gh pr create --title "Pull request title" --body "Pull request body"

In the browser

// Quickly navigate to the pull request creation page
~/Projects/my-project$ gh pr create --web
Opening in your browser.

Working with forks

This command will automatically create a fork for you if you're in a repository that you don't have permission to push to.