Use merge strategies for pull requests
Merge strategies provide you with methods for merging commits. As an administrator or space owner, you can set merge strategies for pull requests in a Git repository.
Note: This functionality is available only with the PulseUno Git server.
Available merge strategies
The following table describes merge strategies that are available by default.
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. For details, see Create merge rules.
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:
|
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:
|
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 documentation. Git command:
|
Set a default strategy for automatic merges
As an administrator or space owner, you can set the default merge strategy for all automatic merges in a Git repository.
To set the default merge strategy:
-
From the spaces list at the top right, select a space.
-
On the Products page, open a Git repository.
-
In the sidebar, select Settings > Reviewing Changes.
-
In the Pull Requests section, select the default merge strategy from the list.
-
Click Save.
PulseUno applies the default merge strategy to all pull requests that are merged automatically.
Enable merge strategies
As an administrator or space owner, you can enable merge strategies to let users choose a merge strategy when they merge pull requests.
To enable merge strategies for pull requests:
-
From the spaces list at the top right, select a space.
-
On the Products page, open a Git repository.
-
In the sidebar, select Settings > Reviewing Changes.
-
In the Pull Requests section, enable merge strategies by selecting them. The default merge strategy is preselected and displayed dimmed.
-
Click Save.
You can now choose one of the enabled merge strategies when you merge a pull request.
See also: