LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

glab-mr-create

Create a new GitLab merge request

TLDR

Create MR interactively
$ glab mr create
copy
Create with title
$ glab mr create -t "[title]"
copy
Create as draft
$ glab mr create --draft -t "[title]"
copy
Create with reviewers
$ glab mr create -t "[title]" --reviewer [user1],[user2]
copy
Create to specific branch
$ glab mr create --target-branch [main]
copy
Fill from commits
$ glab mr create --fill
copy
Skip prompts and push the branch
$ glab mr create --fill --push --yes
copy
Create for a linked issue
$ glab mr create --related-issue [issue-number]
copy

SYNOPSIS

glab mr create [options]

DESCRIPTION

glab mr create creates a new GitLab merge request from the current branch. It supports drafts, reviewer assignment, labels, milestones, and auto-filling title and description from commit messages.When run without flags, it launches an interactive prompt for composing the merge request.

PARAMETERS

-t, --title title

MR title.
-d, --description text
MR description. Use `-` to open an editor.
--draft, --wip
Mark the merge request as a draft.
-a, --assignee users
Assign the MR to users by username; comma-separate or repeat the flag.
--reviewer users
Request review from users by username; comma-separate or repeat the flag.
-b, --target-branch branch
Target/base branch to merge into.
-s, --source-branch branch
Branch to create the MR from (default: current branch).
-f, --fill
Don't prompt for title/description, use commit info instead. Implies --push.
--fill-commit-body
When multiple commits exist, fill the description with every commit body. Requires --fill.
-l, --label labels
Add labels by name; comma-separate or repeat the flag.
-m, --milestone milestone
Assign a milestone by ID or title.
-i, --related-issue issue
Create the MR for an issue; uses the issue title if --title is omitted.
--push
Push local commits to the source branch after creating the MR.
--remove-source-branch
Remove the source branch when the MR is merged.
--squash-before-merge
Squash commits into one when merging.
-H, --head repo
Use another head repository, as `OWNER/REPO`, `GROUP/NAMESPACE/REPO`, a project ID, or a full URL.
--template name
Use a template from `.gitlab/mergerequesttemplates/` to pre-fill the description.
-y, --yes
Skip the submission confirmation prompt. Use with --fill to skip all optional prompts.
-w, --web
Continue MR creation in the browser.

INSTALL

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

SEE ALSO

glab-mr(1), glab(1)

RESOURCES

Copied to clipboard
Kai