Merge changes in pull requests

You can set the merge policy that enables approved pull requests to merge automatically into the target stream or branch. If the automatic merge isn't enabled, you can merge pull requests manually.

Merge pull requests automatically

As an administrator or Git repository owner, you can enable approved pull requests to merge automatically.

If the parent stream or branch are configured to automatically merge pull requests, when a review moves to the Approved state, the pull request is automatically merged into its parent stream or branch.

Automatic merging works only if there are no conflicts when the pull request moves to the Approved state.

Note: If a merge fails, the pull request can be sent back to the Rework state and then approved again.

To enable pull requests to merge automatically:

  1. On the top navigation bar, select a space from the spaces list.

  2. On the Products page, open a product or Git repository.

  3. To enable the automatic merge for a stream or branch, drill down to open the relevant stream or branch.
  4. On the sidebar, select Settings > Reviewing Changes.
  5. In the Pull Requests section, from the Merge Policy list, select a policy that enables automatic merges. For details about merge policies, see Create and apply merge policies.
  6. Click Save.

Back to top

Merge pull requests manually

If the stream or branch has not been configured to automatically merge approved pull requests, or if a pull request fails to merge automatically, merge the pull request manually.

You can do a manual merge only if there are no conflicts between the contents of the topic stream/branch and the target branch.

To merge a pull request manually:

  1. On the top navigation bar, select a space from the spaces list.

  2. (Optional) To restrict the scope of the search, open a product or Git repository and then a stream/branch.

  3. On the sidebar, select Reviews.
  4. From the review list, open the pull request you want to merge to the target stream/branch.
  5. (Optional) In the Conversation tab, review the details, such as the description, related requests, review tags, and assigned reviewers, and make changes, if needed.

    Note: You can edit a review or pull request only if you are its author (owner). Otherwise, you need administrator or space owner permissions.

    For details, see Modify pull requests.

  6. Click Merge Pull Request.
  7. Add a merge comment and click Merge. If the merge is successful, the pull request is automatically closed. If the merge fails, a warning is displayed.

Back to top

See also: