← 返回命令列表

Linux command

gh-pr 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Create a pull request

gh pr create

List open pull requests

gh pr list

Check out a PR branch

gh pr checkout [pr-number]

View PR in browser

gh pr view --web

Merge a pull request

gh pr merge [pr-number]

说明

gh pr manages GitHub pull requests from the command line. It provides full pull request lifecycle management including creation, review, merging, and CI status monitoring. The command integrates with git workflows, automatically detecting the current branch's pull request context. It supports interactive creation with editor integration and automated creation for scripted workflows.

参数

create
Create a new pull request.
list
List pull requests.
checkout
Check out a PR branch locally.
view
View pull request details.
merge
Merge a pull request.
close
Close a pull request.
reopen
Reopen a pull request.
ready
Mark PR as ready for review.
checks
Show CI status checks.
review
Add a review to a PR.
--help
Display help information.

FAQ

What is the gh-pr command used for?

gh pr manages GitHub pull requests from the command line. It provides full pull request lifecycle management including creation, review, merging, and CI status monitoring. The command integrates with git workflows, automatically detecting the current branch's pull request context. It supports interactive creation with editor integration and automated creation for scripted workflows.

How do I run a basic gh-pr example?

Run `gh pr create` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does create do in gh-pr?

Create a new pull request.