glab-mr-merge

Merge a GitLab merge request

TLDR

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

SYNOPSIS

glab mr merge [number] [options]

DESCRIPTION

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.

PARAMETERS

--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.

INSTALL

sudo apt install glab
sudo dnf install glab
sudo pacman -S glab
sudo apk add glab
sudo zypper install glab
brew install glab
nix profile install nixpkgs#glab

SEE ALSO

glab-mr(1), glab-mr-create(1)