doc/user/project/merge_requests/commits.md
{{< details >}}
{{< /details >}}
A commit records and sends the source code changes to the repository. For more information, see recording changes to the repository.
When you use the command line, use git commit.
You can add multiple commits before pushing your changes.
Commit message:
A commit message identifies what is changed and why. Use descriptive messages to clarify the changes. In GitLab, you can add keywords to the commit message to perform one of the following actions:
Trigger a GitLab CI/CD pipeline:
If the project is configured with GitLab CI/CD, you trigger a pipeline per push, not per commit.
Skip pipelines:
Add the ci skip keyword to
your commit message to make GitLab CI/CD skip the pipeline.
Cross-link issues and merge requests:
Use cross-linking to keep track of related parts of your workflow. If you mention an issue or a merge request in a commit message, they are displayed on their respective thread.
Cherry-pick a commit:
In GitLab, you can cherry-pick a commit from the UI.
Revert a commit:
Revert a commit from the UI to a selected branch.
Sign a commit:
Add extra security by signing your commits.
For more information, see stage, commit, and push changes.
Each merge request has a history of the commits made to the source branch after the merge request was created.
These commits are displayed on the merge request's Commits tab. From this tab, you can review commit messages and copy a commit's SHA when you need to cherry-pick changes.
To see the commits included in a merge request:
In the top bar, select Search or go to and find your project.
In the left sidebar, select Code > Merge requests, then select your merge request.
To show a list of the commits in the merge request, newest first, select Commits . To read more about the commit, select Toggle commit description ({{< icon name="ellipsis_h" >}}) on any commit.
To view the changes in the commit, select the title of the commit link.
To view other commits in the merge request, either:
If your merge request builds upon a previous merge request, you might need to include more commits for context.
When you review a merge request, you might need information from previous commits to help understand the commits you're reviewing. You might need more context if another merge request:
To add previously merged commits to a merge request for more context:
Previously merged commits are referred to as Context Commits in the merge request context commits API.
[!warning] Threads created this way are lost if the commit ID changes after a force push.
To add discussion to a specific commit:
To view the changes between previously merged commits:
In the top bar, select Search or go to and find your project.
In the left sidebar, select Code > Merge requests, then select your merge request.
Select Changes.
By Compare ({{< icon name="file-tree" >}}), select the commits to compare:
If you selected to add previously merged commits for context, those commits are also shown in the list.
When you view the commit details page, GitLab links to one or more merge requests that contain that commit.
This behavior only applies to commits that are in the most recent version of a merge request. If the commits were in a merge request and were rebased out of that merge request, the commits are not linked.