gh pr create

Create a pull request


Create a pull request

gh pr create [flags]


  -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
  -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.