debian-mirror-gitlab/doc/user/project/merge_requests/commits.md
2021-10-27 15:23:28 +05:30

3.4 KiB

stage group info type
Create Code Review To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments index, reference

Commits tab in merge requests (FREE)

The Commits tab in a merge request displays a sequential list of commits to the Git branch your merge request is based on. From this page, you can review full commit messages and copy a commit's SHA when you need to cherry-pick changes.

Merge requests commit navigation

Introduced in GitLab 13.0.

To seamlessly navigate among commits in a merge request:

  1. Select the Commits tab.

  2. Select a commit to open it in the single-commit view.

  3. Navigate through the commits by either:

    • Selecting Prev and Next buttons below the tab buttons.
    • Using the X and C keyboard shortcuts.

Merge requests commit navigation

View merge request commits in context

WARNING: This feature is in beta and is incomplete. Previously merged commits can be added, but they can't be removed due to this bug.

This in-development feature might not be available for your use. There can be risks when enabling features still in development. Refer to this feature's version history for more details.

When reviewing a merge request, it helps to have more context about the changes made. That includes unchanged lines in unchanged files, and previous commits that have already merged that the change is built on.

To add previously merged commits to a merge request for more context:

  1. Go to your merge request.

  2. Select the Commits tab.

  3. Scroll to the end of the list of commits, and select Add previously merged commits:

    Add previously merged commits button

  4. Select the commits that you want to add.

  5. Select Save changes.

To view the changes done on those previously merged commits:

  1. On your merge request, select the Changes tab.

  2. Scroll to (file-tree) Compare and select previously merged commits:

    Previously merged commits

Enable or disable viewing merge request commits in context (FREE SELF)

Viewing merge request commits in context is under development and not ready for production use. It is deployed behind a feature flag that is disabled by default. GitLab administrators with access to the GitLab Rails console can enable it.

To enable it:

Feature.enable(:context_commits)

To disable it:

Feature.disable(:context_commits)