Use merge strategies for pull requests

PulseUno provides several methods for merging commits. As an administrator, you can apply these merge strategies to all pull requests in a Git repository.

Note: Merge strategies are not the same as merge rules. Merge strategies control how pull requests are merged, while merge rules control who can merge pull requests.

Available merge strategies

The following table describes merge strategies that are available out of the box.

Merge strategy Description
Merge commit

Keeps all commits from the source branch and makes them part of the destination branch. Use this strategy to keep a detailed, exact history of changes.

This is the default strategy for new projects.

Git command:

git merge --no-ff

Squash

Combines your commits into a single commit when you merge the source branch into the destination branch. Use this strategy to keep a clear and simple history of changes.

Git command:

git merge --squash

Fast forward if possible

Enables a fast-forward merge without creating merge commits when it's possible.

When a fast-forward merge is not possible (when the merged-in history is not a descendant of the current history), a merge commit is created.

For details about fast-forward merging, see the Git help.

Git command:

git merge --ff

Back to top

Set the default merge strategy for automatic merges

As an administrator, you can set the default merge strategy for all automatic merges in a Git repository.

To set the default merge strategy:

  1. In PulseUnot, open Spaces, select a space, and then select a Git repository.

  2. In the sidebar, select Settings > Reviewing Changes.

  3. On the Reviewing Changes page, in the Pull Requests section, select the merge strategy you want to use.

  4. Click Save.

PulseUno applies the default merge strategy to all pull requests that are merged automatically.

Back to top

Enable merge strategies

As an administrator, you can enable merge strategies to let users choose a merge strategy when they merge pull requests.

To enable merge strategies for pull requests:

  1. In PulseUno, open Spaces, select a space, and then select a Git repository.

  2. In the sidebar, select Settings > Reviewing Changes.

  3. On the Reviewing Changes page, in the Pull Requests section, select one or more merge strategies you want to enable.

  4. Click Save.

You can now choose one of the enabled merge strategies when you merge a pull request.

Back to top

See also: