← 返回命令列表

Linux command

glab-mr-merge 命令

文本

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

常用示例

Merge a merge request

glab mr merge [number]

Merge with squash

glab mr merge [number] --squash

Merge without deleting branch

glab mr merge [number] --remove-source-branch=false

Merge when pipeline succeeds

glab mr merge [number] --when-pipeline-succeeds

Merge with a custom commit message

glab mr merge [number] --message "[commit message]"

Merge with rebase

glab mr merge [number] --rebase

说明

glab mr merge merges a GitLab merge request. It supports squash merging, rebasing, automatic source branch deletion, and deferred merging that waits for the CI pipeline to pass before completing.

参数

--squash
Squash commits on merge.
--rebase
Rebase the commits onto the base branch before merging.
--remove-source-branch
Delete source branch after merge.
--when-pipeline-succeeds
Set the merge request to merge when the pipeline succeeds.
--message _text_
Custom merge commit message.
--sha _sha_
Merge when the HEAD of the source branch matches the given SHA. Prevents merging unexpected changes.
-y, --yes
Skip confirmation prompt.

FAQ

What is the glab-mr-merge command used for?

glab mr merge merges a GitLab merge request. It supports squash merging, rebasing, automatic source branch deletion, and deferred merging that waits for the CI pipeline to pass before completing.

How do I run a basic glab-mr-merge example?

Run `glab mr merge [number]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --squash do in glab-mr-merge?

Squash commits on merge.