Have both master and main branches work at the same time, without breaking? #8551

Open
opened 2025-11-02 08:10:34 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @xet7 on GitHub (Feb 11, 2022).

Feature Description

Some CI/CD workflows break when someone renames master branch to main.

What if there would be no need to change branch names, both "master" and "main" would work when there is one of those, and at visible web interfaces would visibly just show text "main", not "master"? This way, there would be no need to manually rename branches, and all repos would be "main" compliant by default. That change would only need to be done to git hosting software, and it would save the world from a lot of breakages.

Screenshots

No response

Originally created by @xet7 on GitHub (Feb 11, 2022). ### Feature Description Some CI/CD workflows break when someone renames master branch to main. What if there would be no need to change branch names, both "master" and "main" would work when there is one of those, and at visible web interfaces would visibly just show text "main", not "master"? This way, there would be no need to manually rename branches, and all repos would be "main" compliant by default. That change would only need to be done to git hosting software, and it would save the world from a lot of breakages. ### Screenshots _No response_
GiteaMirror added the type/enhancementtype/proposal labels 2025-11-02 08:10:34 -06:00
Author
Owner

@xet7 commented on GitHub (Feb 11, 2022):

I also asked this from GitHub https://github.com/github/feedback/discussions/11397

@xet7 commented on GitHub (Feb 11, 2022): I also asked this from GitHub https://github.com/github/feedback/discussions/11397
Author
Owner

@zeripath commented on GitHub (Feb 12, 2022):

You mean symbolic ref main as master or vice versa?

@zeripath commented on GitHub (Feb 12, 2022): You mean symbolic ref main as master or vice versa?
Author
Owner

@xet7 commented on GitHub (Feb 12, 2022):

@zeripath

Both:

  1. Renaming master to main: https://github.com/github/renaming .If master is renamed to main, it would be better that using master would still work.
  2. If someone has not yet renamed master to main, cloning main would be good to work also
  3. Web UI could always show that branch name is main. So nobody would have to make manual renames of branches.
@xet7 commented on GitHub (Feb 12, 2022): @zeripath Both: 1. Renaming master to main: https://github.com/github/renaming .If master is renamed to main, it would be better that using master would still work. 2. If someone has not yet renamed master to main, cloning main would be good to work also 3. Web UI could always show that branch name is main. So nobody would have to make manual renames of branches.
Author
Owner

@zeripath commented on GitHub (Feb 12, 2022):

git symbolic-ref refs/heads/master refs/heads/main
@zeripath commented on GitHub (Feb 12, 2022): ``` git symbolic-ref refs/heads/master refs/heads/main ```
Author
Owner

@fnetX commented on GitHub (Feb 16, 2022):

Please keep in mind that not everyone uses master/main terminology. While I personally don't object from main to the default branch, this might be unexpected to some users.

Implementing something like the rename feature in Gitea might be a good idea: If branch A is renamed to B, it is a symbolic ref until an actual branch A is pushed.

@fnetX commented on GitHub (Feb 16, 2022): Please keep in mind that not everyone uses `master`/`main` terminology. While I personally don't object from main to the default branch, this might be unexpected to some users. Implementing something like the rename feature in Gitea might be a good idea: If branch A is renamed to B, it is a symbolic ref until an actual branch A is pushed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8551