Github will be switching to main naming scheme for the default branch of new projects, at some point this summer.
main is the most popular replacement for master that we’re seeing across GitHub. We like it because it’s short, it keeps your muscle memory intact, and it translates well across most languages. We’re using main for our newly-created repositories and for the repositories we’re moving now, like dependabot-core.
With gitlab 13.2 we are able to change the default value of the branch name as well in gitlab.gnome.org. I am proposing we switch it to main following the other popular git hosting services.
I think the consensus of the other discourse thread and the d-d-l thread is to move away from the master term for new things and investigate how feasible migration for existing repos is.
The only issue I can think of with changing the default is the weird limbo where some projects will use master and others main for the default branch, but given that Github and Gitlab have decided to go on with the same change its not something that we are going to avoid anyway.
flatpak and flatpak-builder will need fixing before this can happen though, as both of those currently fail to detect the default branch and will instead hardcode “master”. A fix similar to this one will be necessary:
We can definitely switch the default for new projects now, at zero cost; then we can migrate existing projects incrementally, since it has to be done semi-manually, and leave an opt out for projects that don’t want to change.
The reason why we need an incremental move is that some projects have CI scripts that reference the master branch as the default, and they would need time to adjust them, so it cannot be done with a GNOME-wide flag day.
The original post says there was some kind of consensus in the linked thread. This is a friendly reminder that consensus was not to change the branch name, just in case there should be any doubt.
The rough consensus was that changing the default branch of existing projects was made harder than necessary by Git, and required manual intervention. There was no opinion expressed on the default branch for new projects.
And even for the existing projects, that loud minority that didn’t want to lift a finger shouldn’t be considered consensus, especially as we never even started discussing how it would be implemented.