Scroll to navigation

glab(1) glab(1)

NAME

glab-mr-note-create - Create a comment or discussion on a merge request. (EXPERIMENTAL)

SYNOPSIS

glab mr note create [ | ] [flags]

DESCRIPTION

Add a comment to a merge request. The command creates the comment as a new discussion thread.

Use --reply to add a note to an existing discussion thread instead of starting a new one. The value can be a full discussion ID or a unique prefix of at least 8 characters.

Use --file to place a diff comment on a specific file in the latest merge request diff version. Combine with --line (new side) or --old-line (old/removed side) to target a specific line. Omit both flags for a file-level comment.

The flag rules are:

  • --line and --old-line require --file, and cannot be used together.
  • --file, --reply, and --unique are mutually exclusive.

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

OPTIONS

--file="" File path for a diff comment, like . Targets the latest merge request diff version.

--line="" Line in the new version. A single line number, like 42, or a range, like 10:15.

-m, --message="" Comment or note message.

--old-line=0 Line in the old version, for commenting on a removed line.

--reply="" Reply to an existing discussion. Accepts a full discussion ID or a prefix of 8 or more characters.

--unique[=false] Don't create a note if a note with the same body already exists. Reads all merge request comments first.

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

# Add a comment to merge request 123
glab mr note create 123 -m "Looks good to me!"
# Add a comment to the current branch's merge request
glab mr note create -m "LGTM"
# Open editor to compose the message
glab mr note create 123
# Pipe from stdin
echo "LGTM" | glab mr note create 123
# Skip if already posted
glab mr note create 123 -m "LGTM" --unique
# Reply to an existing discussion thread
glab mr note create 123 --reply abc12345 -m "I agree!"
# Add a diff comment on line 42 of main.go
glab mr note create 123 --file main.go --line 42 -m "Needs refactoring"
# Add a diff comment on lines 10-15 (multiline range)
glab mr note create 123 --file main.go --line 10:15 -m "Extract this block"
# Add a diff comment on a removed line (old side)
glab mr note create 123 --file main.go --old-line 7 -m "Why was this removed?"
# Add a file-level diff comment (no line specified)
glab mr note create 123 --file main.go -m "General comment on this file"

SEE ALSO

glab-mr-note(1)

May 2026 Auto generated by spf13/cobra