Change default target branch for merge requests
Problem to solve
When using the Gitflow methodology, it makes sense to use master
as the default branch for things like:
- Showing the README
- Showing the network graph
- Master is on the far-right
- Develop shows to its left
- Feature branches show to the far-left
- Cloning the project
However, all merge requests should be made against the develop
branch instead.
Further details
By making master
the default, we lose the ability to efficiently use the automatic "create merge request" button which appears when you push a new branch. Extra steps are required to change the target branch to develop
.
Currently this can only be resolved by changing the default branch for everything to develop
. However, that also means that:
- The README wouldn't show the latest version (if #2509 (closed) is implemented)
- The network graph no longer has the ideal horizontal display order
- Develop is on the far-right
- Feature branches are in the middle
- Master is on the far-left
- Deploying the project with
git clone
requires an additionalgit checkout -t origin/master
command
This situation is not ideal either. However, if we could set a separate default branch for MRs only, that would provide Gitflow users with the best of both worlds.
Proposal
- create a second option to set a separate branch as the: Default branch for new merge requests
Links / references
Edited by James Ramsay (ex-GitLab)