We have a project with following three main branches:
Our default merging strategy is Squash, fast-forward only --squash --ff-only i.e., If the source branch is out of date with the target branch, reject the merge request. Otherwise, combine all commits into one new non-merge commit on the target branch.
We like this strategy for PRs where the source branch is a temporary branch created by the developer for purposes of code-checkin, but this policy is not desired when the source branch is one of {development, staging, release}. And I think this is a common use-case and scenario. However we cannot find any setting to allow a different merge strategy when the source branch is one of {development, staging, release}.
How can we do this? I think what we are asking is common practice in development where any on-going changes are committed as --squash --ff-only by developers but merges between the three canonical branches are made using the traditional merge strategy of Merge commit --no-ff i.e.:
Always create a new merge commit and update the target branch to it, even if the source branch is already up to date with the target branch.