To rename your local “master” branch on your machine, you'll just need to run a simple one liner command. This will update your local master branch but not the remote branch. Later on we also need to look at renaming the remote master branch and changing the default branch name in the git repository.
Every Git repository has an initial branch, which is the first branch to be created when a new repository is generated. Historically, the default name for this initial branch was master . This term came from Bitkeeper, a predecessor to Git.
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
In 8.0+ it looks like this was moved into the project. If you open your project and go to the gear icon on the right, then "Edit Project" you can set the default branch for the project.
To change default branch in GitLab:
1. Settings > General > General project settings > Expand
2. Default Branch > Change your project default branch
3. Save changes
For gitlab v10+ (as of Sept 2018), this has moved to settings-> repository -> default branch
As stated by @Luke this is still valid as on 4/1/2021
To change the default branch in Gitlab 7.7.2:
In the latest GitLab Community Edition version 9.2.2.:
Please refer image below:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With