glab-mr-create
Create GitLab merge requests from the command line
TLDR
Interactively create a merge request
Create a merge request, determining the title and description from the commit messages of the current branch
Create a draft merge request
Create a merge request specifying the target branch, title, and description
Start opening a merge request in the default web browser
SYNOPSIS
glab mr create [<source-branch>] [options...]
PARAMETERS
-a, --assignee <usernames>
Comma-separated list of usernames to assign the MR to
-l, --label <labels>
Comma-separated list of labels to apply to the MR
-t, --title <string>
Title of the merge request
-d, --description <string>
Description message for the MR (use - for stdin)
-m, --message <file>
File containing the MR message
--draft
Mark the MR as a draft
--milestone <id|#title>
Milestone ID or title to associate
--remove-source-branch
Remove source branch after successful merge (default true)
--target <branch>
Target branch for the MR
--reviewer <usernames>
Comma-separated list of reviewers
-R, --repo <owner/repo>
Repository to target (defaults to current)
-s, --source-branch <branch>
Source branch (defaults to current branch)
DESCRIPTION
The glab mr create command is part of the glab tool, an open-source GitLab CLI client designed to bring GitLab functionality to the terminal. It enables users to create new merge requests (MRs) directly from the command line without needing a web browser.
By default, it uses the current Git branch as the source branch and the repository's default base branch (often main or master) as the target. Users can specify custom source/target branches, titles, descriptions, labels, assignees, reviewers, and more via flags. After creation, it supports options like auto-approving, marking as draft, or removing the source branch post-merge.
This streamlines workflows for developers, especially in CI/CD pipelines or when working in environments without GUI access. It requires prior authentication via glab auth login and a Git repository configured with a GitLab remote. The command pushes the source branch if needed (configurable) and opens the MR in the browser by default.
CAVEATS
Requires glab auth login and GitLab remote; source branch must be pushed if not remote; maintainer perms needed for --approve.
EXAMPLES
glab mr create --title "Fix bug" --label bugfix
glab mr create feature-branch --target develop --description "@file.md"
DEFAULTS
Auto-pushes source branch (--push-after-create); opens MR in browser; sets delete_source_branch=true.
HISTORY
Introduced in glab v1.0 (2021) by the GitLab CLI team as part of efforts to enhance terminal-based GitLab workflows; actively maintained with features added in v1.18+ for draft MRs and reviewers.
SEE ALSO
glab(1), glab mr list(1), glab mr view(1), git-request-pull(1)


