I accidentally pushed my local master to a branch called origin on gitlab and now it is the default. Is there a way to rename this branch or set a new master branch to maste
See also GitLab 13.6 (November 2020)
Customize the initial branch name for new projects within a group
When creating a new Git repository, the first branch created is named
master
by default.In coordination with the Git project, broader community, and other Git vendors, GitLab has been listening to the development community’s feedback on determining a more descriptive and inclusive name for the default branch, and is now offering users options to change the name of the default branch name for their repositories.
Previously, we shipped the ability to customize the initial branch name at the instance-level and as part of 13.6, GitLab now allows group administrators to configure the default branch name for new repositories created through the GitLab interface.
See Documentation and Issue.
in the GitLab Enterprise Edition 12.2.0-pre you have to use following:
Setting
→ Repository
→ Default Branch
( expand it) and change the default branch Here
To change default branch in GitLab:
1. Settings > General > General project settings > Expand
2. Default Branch > Change your project default branch
3. Save changes
In the latest GitLab Community Edition version 9.2.2.:
Please refer image below:
To change the default branch in Gitlab 7.7.2: