GH-PR-CREATE(1) | GitHub CLI manual | GH-PR-CREATE(1) |
gh-pr-create - Create a pull request
gh pr create [flags]
Create a pull request on GitHub.
When the current branch isn't fully pushed to a git remote, a prompt will ask where to push the branch and offer an option to fork the base repository. Use --head to explicitly skip any forking or pushing behavior.
A prompt will also ask for the title and the body of the pull request. Use --title and --body to skip this, or use --fill to autofill these values from git commits.
Link an issue to the pull request by referencing the issue in the body of the pull request. If the body text mentions Fixes #123 or Closes #123, the referenced issue will automatically get closed when the pull request gets merged.
By default, users with write access to the base repository can push new commits to the head branch of the pull request. Disable this with --no-maintainer-edit.
Adding a pull request to projects requires authorization with the "project" scope. To authorize, run "gh auth refresh -s project".
$ gh pr create --title "The bug is fixed" --body "Everything works again" $ gh pr create --reviewer monalisa,hubot --reviewer myorg/team-name $ gh pr create --project "Roadmap" $ gh pr create --base develop --head monalisa:feature
Feb 2023 |