← 返回命令列表

Linux command

gh-pr-merge 命令

文本

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

常用示例

Merge current PR

gh pr merge

Merge with squash

gh pr merge --squash

Merge with rebase

gh pr merge --rebase

Delete branch after merge

gh pr merge --delete-branch

Auto-merge when ready

gh pr merge --auto

说明

gh pr merge merges pull requests using GitHub's merge API. It supports all merge strategies: merge commits, squash merging, and rebasing. The command can wait for required checks and approvals before proceeding. Auto-merge (--auto) sets a PR to merge automatically once all requirements are satisfied, useful for approved PRs waiting on CI. The --delete-branch option cleans up feature branches after merging.

参数

--merge
Use merge commit (default).
--squash
Squash commits into one.
--rebase
Rebase commits onto base branch.
--delete-branch
Delete branch after merge.
--auto
Enable auto-merge when requirements met.
--admin
Merge with admin privileges.
--body _TEXT_
Custom merge commit message.
--help
Display help information.

FAQ

What is the gh-pr-merge command used for?

gh pr merge merges pull requests using GitHub's merge API. It supports all merge strategies: merge commits, squash merging, and rebasing. The command can wait for required checks and approvals before proceeding. Auto-merge (--auto) sets a PR to merge automatically once all requirements are satisfied, useful for approved PRs waiting on CI. The --delete-branch option cleans up feature branches after merging.

How do I run a basic gh-pr-merge example?

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

What does --merge do in gh-pr-merge?

Use merge commit (default).