GitLab suggested changes: how to suggest, batch and apply code suggestions

By Melih Toksari, developer of MergeBell · Updated · 3 min read

Short answer

In a merge request's diff, comment on a line and select Insert suggestion: GitLab adds a suggestion block containing that line for you to edit. Change the header to suggestion:-N+M to cover lines above and below — up to 100 each way. The author, or anyone with at least the Developer role, can apply it: GitLab commits the change, credited to whoever suggested it, and resolves the thread. Add suggestion to batch applies several in one commit.

“Rename this variable” takes the author a minute to understand and another to do. A suggestion takes them one click. It is the fastest feedback loop in GitLab code review, available on every tier, and it works just as well from a phone. Here is everything about it, as of GitLab 19.5.

How to write a suggestion

  1. Open the merge request’s Changes tab and find the line.

  2. Select Add a comment to this line on its line number. To cover several lines, select and drag across them.

  3. In the comment toolbar, select Insert suggestion. GitLab adds a block containing the current line:

    ```suggestion:-0+0
    const retryDelay = 1000;
    ```
  4. Edit the code inside the block to read the way it should — const retryDelay = 2000; — and add a sentence saying why.

  5. Select Add comment now, or Start a review to publish it with the rest of your review.

The author sees a diff of your change, with an Apply suggestion button under it.

How to suggest a change across several lines

The numbers in suggestion:-0+0 are how many lines above and below the commented line the suggestion replaces. suggestion:-2+2 replaces from two lines above to two lines below — five lines in all. GitLab allows up to 100 lines above and 100 below, so one suggestion can replace up to 201 lines. Selecting a range of lines before you insert the suggestion sets these numbers for you.

Keep suggestions small. A suggestion is for a fix the author would accept without discussion; a redesign belongs in a comment.

How to apply a suggestion

You can apply a suggestion if you are the merge request’s author, or have the Developer, Maintainer or Owner role in the project:

  1. Find the comment, and select Apply suggestion.
  2. Optionally, write a commit message.
  3. Select Apply.

GitLab then marks the suggestion Applied, resolves the thread, and adds a commit to the merge request — authored by the person who suggested it, so the credit goes where it belongs. To decline instead, reply with your reason and resolve the thread.

How to apply several suggestions in one commit

A review with ten suggestions should not add ten commits:

  1. On each suggestion you want, select Add suggestion to batch (and Remove from batch to take one out).
  2. Select Apply suggestions, and optionally write a commit message.

You need permission to commit to the source branch. One thing to know: a batch commit lists you as both its author and committer. If the project has the approval setting that prevents approvals by users who add commits, applying a batch means you can no longer approve that merge request.

How to set the commit message

Without a custom message, GitLab uses the project’s template — by default Apply %{suggestions_count} suggestion(s) to %{files_count} file(s). A Maintainer can change it in the project’s merge request settings, using variables such as:

Variable Becomes
%{suggestions_count} How many suggestions were applied
%{files_count} How many files they touched
%{file_paths} The files’ paths, comma-separated
%{branch_name} The branch they were applied to
%{username} / %{user_full_name} Who applied them
%{co_authored_by} A Co-authored-by: trailer for each suggestion’s author

%{co_authored_by} is worth adding to batch commits, since they otherwise credit only the person who applied them. Merge requests from forks use the target project’s template.

Suggestions on a phone

Suggestions are the review tool that suits a phone best: a one-line fix you can write with your thumb, which the author applies without opening an editor. In MergeBell, writing suggestion blocks, previewing them as a diff, and applying one or a whole batch in one tap are part of Pro. Line comments, approve and merge are free. See also how to review a GitLab merge request on your phone.

Frequently asked questions

How do I suggest a change in a GitLab merge request?

Open the merge request's Changes tab, comment on the line, and select Insert suggestion in the comment toolbar. Edit the code inside the suggestion block, then add the comment now or as part of a review.

Can I suggest changes to multiple lines in GitLab?

Yes. Select several lines when you start the comment, or edit the block's header: suggestion:-2+2 replaces from two lines above to two lines below the commented line. GitLab allows up to 100 lines above and 100 below.

Who can apply suggestions in GitLab?

The merge request's author, or anyone with the Developer, Maintainer or Owner role in the project. Applying a batch also requires permission to commit to the source branch.

Can I apply several GitLab suggestions in one commit?

Yes. Select Add suggestion to batch on each one, then Apply suggestions. The batch becomes a single commit with you as its author and committer.

Sources

Checked against these pages on 16 October 2026. GitLab changes quickly — if something here no longer matches, tell us and we will fix it.

Do this from your phone with MergeBell

Free for the whole review loop: the To-Do inbox, diffs and line comments, approve and merge, pipelines with retry, and push alerts for your To-Dos. Works with gitlab.com and self-managed GitLab 16.0+.

Get MergeBell for AndroidiPhone: email me at launch

On Google Play for Android 12 or later. The iPhone app is coming soon to the App Store. An independent app, not affiliated with GitLab Inc.