Renaming of the default branch to main #7250

Closed
opened 2025-11-02 07:20:51 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @pat-s on GitHub (Apr 26, 2021).

Given the well-known reasons for getting rid of the term master for branches in programming, I would like to push the idea of doing so in this repository.

GitHub default branch renaming is quite sophisticated and I'd expect little interruption for users.

Maintainers would need to make adjustments to CI runners eventually.

Originally created by @pat-s on GitHub (Apr 26, 2021). Given the well-known reasons for getting rid of the term `master` for branches in programming, I would like to push the idea of doing so in this repository. GitHub default branch renaming is quite sophisticated and I'd expect little interruption for users. Maintainers would need to make adjustments to CI runners eventually.
GiteaMirror added the type/miscellaneous label 2025-11-02 07:20:51 -06:00
Author
Owner

@techknowlogick commented on GitHub (Apr 27, 2021):

As discussed in chat, this is what we'd like to do. A note for when the branch is changed is that when it is run a bunch of CI runs will happen at once so a bunch of jobs will need to be cancelled, also that branch protection would need to be updated.

Two things that need to happen prior to making the change, 1. the drone yaml (as mentioned above), and 2. a redirect for dl.gitea.io for where the bleeding edge binaries are stored.

I'm happy with this change as I updated a bunch of my local tooling to adapt to many other forges/repos making this change and I have my gitea stuff pinned to an older version of my scripts so updating this repo would mean I could update those too.

@techknowlogick commented on GitHub (Apr 27, 2021): As discussed in chat, this is what we'd like to do. A note for when the branch is changed is that when it is run a bunch of CI runs will happen at once so a bunch of jobs will need to be cancelled, also that branch protection would need to be updated. Two things that need to happen prior to making the change, 1. the drone yaml (as mentioned above), and 2. a redirect for dl.gitea.io for where the bleeding edge binaries are stored. I'm happy with this change as I updated a bunch of my local tooling to adapt to many other forges/repos making this change and I have my gitea stuff pinned to an older version of my scripts so updating this repo would mean I could update those too.
Author
Owner

@a1012112796 commented on GitHub (Apr 27, 2021):

so maybe we need a vote to decide whether we need rename master branch to main or not.

@a1012112796 commented on GitHub (Apr 27, 2021): so maybe we need a vote to decide whether we need rename ``master`` branch to ``main`` or not.
Author
Owner

@silverwind commented on GitHub (Apr 27, 2021):

I would stick to git's default which is still master.

@silverwind commented on GitHub (Apr 27, 2021): I would stick to [git's default](https://git-scm.com/docs/git-init#Documentation/git-init.txt---initial-branchltbranch-namegt) which is still `master`.
Author
Owner

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (Apr 28, 2021):

I would stick to git's default which is still master.

yes, it still is, for now anyway.
image

For my personal stuff I usually now just go with main but for bigger projects I'd probably just wait until git changes the default, I don't know...

Ultimately it's not too much work to change it right away, the branch changes in .drone.yml could even be prepared in advance, accepting both {main,master} fir the moment and pushed (merged) with [skip ci] until the thing is ready in other places, then clean up .drone.yml back to a single branch and links in Docs and other places or what have you.

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (Apr 28, 2021): > I would stick to [git's default](https://git-scm.com/docs/git-init#Documentation/git-init.txt---initial-branchltbranch-namegt) which is still `master`. yes, it *still is*, for now anyway. ![image](https://user-images.githubusercontent.com/61180606/116377177-35798980-a811-11eb-996c-2f1daa76aff2.png) For my personal stuff I usually now just go with `main` but for bigger projects I'd probably just wait until git changes the default, I don't know... Ultimately it's not too much work to change it right away, the branch changes in `.drone.yml` could even be prepared in advance, accepting both {main,master} fir the moment and pushed (merged) with `[skip ci]` until the thing is ready in other places, then clean up `.drone.yml` back to a single branch and links in Docs and other places or what have you.
Author
Owner

@pat-s commented on GitHub (Apr 28, 2021):

The work that needs to be done won't change. I do not see how git init calls are related to the default branch of this repo.

I would like to emphasise the motivations for this change again which boils down to values.

@pat-s commented on GitHub (Apr 28, 2021): The work that needs to be done won't change. I do not see how `git init` calls are related to the default branch of **this** repo. I would like to emphasise the [motivations for this change](https://www.theserverside.com/feature/Why-GitHub-renamed-its-master-branch-to-main) again which boils down to values.
Author
Owner

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (Apr 28, 2021):

I do not see how git init calls are related to the default branch of this repo.

yeah, no worries...a demonstration of git's default branch warning/info message?
it was a reaction to silverwind mentioning what even for git currently stays as a default, although - per their words - subject to change.

the point being along the lines of "they are also considering a change, why not wait until it's the default".

it's only related to the default branch of this repo in that the versioning tool's default is something and we're talking something else.

of course the decision to change this project's default branch has little to do with whatever the current versioning tool's default value is.

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (Apr 28, 2021): > I do not see how `git init` calls are related to the default branch of **this** repo. yeah, no worries...a demonstration of git's default branch warning/info message? it was a reaction to silverwind mentioning what even for git currently stays as a default, although - per their words - subject to change. the point being along the lines of "they are also considering a change, why not wait until it's the default". it's only related to the default branch of **this** repo in that the versioning tool's default is something and we're talking something else. of course the decision to change *this project's* default branch has little to do with whatever the current versioning tool's default value is.
Author
Owner

@pat-s commented on GitHub (Apr 28, 2021):

Maybe this is a misunderstanding for some here - the default branch for new gitea repos is already main.

This is about the default branch of this GitHub repo :)

@pat-s commented on GitHub (Apr 28, 2021): Maybe this is a misunderstanding for some here - the default branch for new gitea repos is already `main`. This is about the default branch of **this GitHub repo** :)
Author
Owner

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (Apr 28, 2021):

oh no, I get it perfectly.
main as the default branch in Gitea is for new installations perhaps, AFAIK it's set in the config.

I don't know why I have the weird thing in my head that says let's wait for git to change the default so that it really is a new standard default branch name (FWIW they could absolutely settle for a different default than main and now the whole world is stuck with it), but it's absolutely any project's decision to use anything as their default branch.

so the line of reasoning is to pick a sane new default that won't be changing anytime soon

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (Apr 28, 2021): oh no, I get it perfectly. main as the default branch in Gitea is for new installations perhaps, AFAIK it's set in the config. I don't know why I have the weird thing in my head that says let's wait for git to change the default so that it really is a new standard default branch name (FWIW they could absolutely settle for a different default than main and now the whole world is stuck with it), but it's absolutely any project's decision to use anything as their default branch. so the line of reasoning is to pick a sane new default that won't be changing anytime soon
Author
Owner

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (Apr 28, 2021):

what would this do in terms of backward compatibility, though?

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (Apr 28, 2021): what would this do in terms of backward compatibility, though?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7250