LinuxCommandLibrary

gh-pr

Manage GitHub pull requests from the command line.

TLDR

Create a pull request

$ gh pr create
copy


Check out a specific pull request locally
$ gh pr checkout [pr_number]
copy


View the changes made in the pull request for the current branch
$ gh pr diff
copy


Approve the pull request for the current branch
$ gh pr review --approve
copy


Merge the pull request associated with the current branch interactively
$ gh pr merge
copy


Edit a pull request interactively
$ gh pr edit
copy


Edit the base branch of a pull request
$ gh pr edit --base [branch_name]
copy


Check the status of the current repository's pull requests
$ gh pr status
copy

SYNOPSIS

gh pr <command> [flags]

DESCRIPTION

Work with GitHub pull requests

COMMANDS

gh-pr-checkout(1)

Check out a pull request in git

gh-pr-checks(1)

Show CI status for a single pull request

gh-pr-close(1)

Close a pull request

gh-pr-comment(1)

Create a new pr comment

gh-pr-create(1)

Create a pull request

gh-pr-diff(1)

View changes in a pull request

gh-pr-edit(1)

Edit a pull request

gh-pr-list(1)

List and filter pull requests in this repository

gh-pr-merge(1)

Merge a pull request

gh-pr-ready(1)

Mark a pull request as ready for review

gh-pr-reopen(1)

Reopen a pull request

gh-pr-review(1)

Add a review to a pull request

gh-pr-status(1)

Show status of relevant pull requests

gh-pr-view(1)

View a pull request

OPTIONS

-R, --repo <[HOST/]OWNER/REPO>

Select another repository using the [HOST/]OWNER/REPO format

EXAMPLE

$ gh pr checkout 353
$ gh pr create --fill
$ gh pr view --web

SEE ALSO

gh(1)

Copied to clipboard