2021-01-11 16:23:31 +00:00
|
|
|
# gh pr
|
2020-10-19 18:29:43 +01:00
|
|
|
|
2021-05-20 21:13:41 +01:00
|
|
|
> Manage GitHub pull requests from the command-line.
|
2022-10-04 04:26:15 +01:00
|
|
|
> Some subcommands such as `gh pr create` have their own usage documentation.
|
2020-10-19 18:29:43 +01:00
|
|
|
> More information: <https://cli.github.com/manual/gh_pr>.
|
|
|
|
|
|
|
|
- Create a pull request:
|
|
|
|
|
|
|
|
`gh pr create`
|
|
|
|
|
2022-05-02 11:55:38 +01:00
|
|
|
- Check out a specific pull request locally:
|
2020-10-19 18:29:43 +01:00
|
|
|
|
|
|
|
`gh pr checkout {{pr_number}}`
|
|
|
|
|
2022-05-02 11:55:38 +01:00
|
|
|
- View the changes made in the pull request for the current branch:
|
2020-10-19 18:29:43 +01:00
|
|
|
|
|
|
|
`gh pr diff`
|
|
|
|
|
2022-05-02 11:55:38 +01:00
|
|
|
- Approve the pull request for the current branch:
|
2020-10-19 18:29:43 +01:00
|
|
|
|
|
|
|
`gh pr review --approve`
|
|
|
|
|
2021-04-15 18:04:49 +01:00
|
|
|
- Merge the pull request associated with the current branch interactively:
|
2020-10-19 18:29:43 +01:00
|
|
|
|
|
|
|
`gh pr merge`
|
2021-03-08 20:27:00 +00:00
|
|
|
|
|
|
|
- Edit a pull request interactively:
|
|
|
|
|
|
|
|
`gh pr edit`
|
|
|
|
|
|
|
|
- Edit the base branch of a pull request:
|
|
|
|
|
|
|
|
`gh pr edit --base {{branch_name}}`
|
2022-05-02 11:55:38 +01:00
|
|
|
|
|
|
|
- Check the status of the current repository's pull requests:
|
|
|
|
|
|
|
|
`gh pr status`
|