← 返回命令列表

Linux command

git-pr 命令

文本

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

常用示例

Check out pull request

git pr [123]

Check out from upstream

git pr [123] upstream

Clean up PR branch

git pr clean [123]

List pull requests

git pr list

说明

git pr checks out GitHub pull requests locally for testing, reviewing, or contributing. It fetches the pull request reference and creates a local branch named "pr/N" for the specified PR number. The command simplifies the review workflow by handling ref fetching and branch creation in a single step. For GitLab repositories, the equivalent command is `git mr`.

参数

clean _NUMBER_
Delete local PR branch.
list
List open PRs.
--help
Display help information.

FAQ

What is the git-pr command used for?

git pr checks out GitHub pull requests locally for testing, reviewing, or contributing. It fetches the pull request reference and creates a local branch named "pr/N" for the specified PR number. The command simplifies the review workflow by handling ref fetching and branch creation in a single step. For GitLab repositories, the equivalent command is `git mr`.

How do I run a basic git-pr example?

Run `git pr [123]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does clean _NUMBER_ do in git-pr?

Delete local PR branch.