home | help
glab(1) 								 glab(1)

NAME
     glab-mr-create - Create a new merge request.

SYNOPSIS
     glab mr create [flags]

DESCRIPTION
     Defaults to the current branch as the source branch. Use --fill to automat-
     ically  fill the title and description from the commit history. Use --draft
     to create a draft merge request.

     --attach uploads a file and references it at the end  of  the  description.
     Repeat  the  flag	for  more than one file, or pass - to read the file from
     standard input. Files upload to the target project, so the  references  re-
     solve even for a merge request from a fork.

     The  --attach flag is an experiment. It might be unstable or removed at any
     time, and is not ready for  production  use.   For  more  information,  see
     https://docs.gitlab.com/policy/development_stages_support/.

     The --recover flag is an experiment: it might be unstable or removed at any
     time,  and  is  not  ready  for  production  use. For more information, see
     https://docs.gitlab.com/policy/development_stages_support/.

OPTIONS
     --allow-collaboration[=false]	Allow commits from other members. Set to
     true/false to override project defaults, or omit to use project settings.

     -a, --assignee=[]	    Assign merge request to people by  their  usernames.
     Multiple  usernames  can  be  comma-separated or specified by repeating the
     flag.

     --attach=[]      (EXPERIMENTAL) Upload a file and reference it at	the  end
     of  the  description.  Use "-" to read the file from standard input. Repeat
     the flag to attach multiple files.

     --auto-merge[=false]      Set the merge request to  merge	when  all  merge
     checks pass.

     --copy-issue-labels[=false]       Copy  labels  from issue to the merge re-
     quest. Used with --related-issue.

     --create-source-branch[=false]	 Create a source branch if it  does  not
     exist.

     -d,  --description=""	 Supply a description for the merge request. Set
     to "-" to open an editor.

     --description-file=""	Read the merge request description from a  file.
     Use "-" to read from standard input.

     --draft[=false]	  Mark merge request as a draft.

     -f,  --fill[=false]       Do  not prompt for title or description, and just
     use commit info. Pushes the branch unless --push=false is set.

     --fill-commit-body[=false]      Fill description with each commit body when
     multiple commits. Can only be used with --fill.

     -H, --head=""	Select another head repository using the  OWNER/REPO  or
     GROUP/NAMESPACE/REPO format, the project ID, or the full URL.

     -l,  --label=[]	   Add label by name. Multiple labels can be comma-sepa-
     rated or specified by repeating the flag.

     -m, --milestone=""      The global ID or title of a milestone to assign.

     --no-editor[=false]      Don't open editor to enter a description. If true,
     uses prompt. Defaults to false.

     --push[=false]	 Push committed changes before creating  the  merge  re-
     quest.  Make sure you have committed changes. Defaults to true with --fill.
     Use --push=false to skip the push.

     --recover[=false]	    Save the options to a file if the merge request cre-
     ation fails. If the file exists, the options are loaded from  the	recovery
     file. (EXPERIMENTAL)

     -i, --related-issue=""	 Create a merge request for an issue. If --title
     is not provided, uses the issue title.

     --remove-source-branch[=false]	  Remove  source branch on merge. Set to
     true/false to override project defaults, or omit to use project settings.

     --reviewer=[]	Request review from users by their  usernames.	Multiple
     usernames can be comma-separated or specified by repeating the flag.

     --signoff[=false]	     Append  a DCO signoff to the merge request descrip-
     tion.

     -s, --source-branch=""	 Create a merge request from  this  branch.  De-
     fault is the current branch.

     --squash-before-merge[=false]	Squash commits into a single commit when
     merging.  Set  to	true/false  to override project defaults, or omit to use
     project settings.

     -b, --target-branch=""	 The target or base branch into which  you  want
     your code merged into.

     --template=""	 Template  to  pre-populate  the  description. A name is
     looked up in '.gitlab/merge_request_templates/' of  the  local  repository,
     and the '.md' extension is optional. A value that is absolute or contains a
     path  separator  is  read	as  a  file  path, for example '~/templates/fea-
     ture.md'.

     -t, --title=""	 Supply a title for the merge request.

     -w, --web[=false]	    Continue merge request creation in a browser.

     --wip[=false]	Mark merge request as a draft. Alternative to --draft.

     -y, --yes[=false]	    Skip submission confirmation prompt. Use  --fill  to
     skip all optional prompts.

OPTIONS INHERITED FROM PARENT COMMANDS
     -h, --help[=false]      Show help for this command.

     -R, --repo=""	Select another repository. You can use either OWNER/REPO
     or GROUP/NAMESPACE/REPO. The full URL or Git URL is also accepted.

EXAMPLE
     # Create a merge request interactively from the current branch
     glab mr new

     # Assign a user and set a title without prompting for description
     glab mr create -a username -t "fix annoying bug"

     # Fill title and description from commits, mark as draft, add a label
     glab mr create -f --draft --label RFC

     # Fill from commits and preview the compare page in the browser
     glab mr create --fill --web

     # Fill from commits, expand each commit body into the description
     glab mr create --fill --fill-commit-body --yes

     # Fill from commits without pushing, for a branch already on the remote
     glab mr create --fill --push=false --yes

     # Use a merge request template for the description
     glab mr create -t "Fix login bug" --template bug_fix
     glab mr create -t "Security patch" --template security_fix.md --yes

     # Use a template file from outside the repository
     glab mr create -t "Fix login bug" --template ~/team-templates/bug_fix.md

     # Create against another project without a local clone. All inputs must be passed as flags; no --push, --fill, or --template.
     glab mr create --repo group/project --source-branch feature-branch --target-branch main --title "Add feature" --description "Details..." --yes

     # Create a fork merge request from your fork into the upstream project, without a local clone.
     glab mr create --repo upstream/project --head your-namespace/project --source-branch feature-branch --target-branch main --title "Add feature" --description "Details..." --yes

     # Read the description from a file
     glab mr create -t "Fix login bug" --description-file description.md

     # Read the description from standard input
     cat description.md | glab mr create -t "Fix login bug" --description-file -

     # Attach a screenshot to the description
     glab mr create -t "Fix login bug" -d "Before and after:" --attach ./before.png --attach ./after.png

SEE ALSO
     glab-mr(1)

Auto generated by spf13/cobra	    Nov 2026				 glab(1)

home | help