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
For gitlab v10+ (as of Sept 2018), this has moved to settings-> repository -> default branch
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.
First I needed to remote into my server with ssh. If someone has a non ssh way of doing this please post.
I found my bare repositories at
cd /var/opt/gitlab/git-data/repositories/group-name/project-name.git
used
git branch
to see the wrong active branch
git symbolic-ref HEAD refs/heads/master
to change the master to to be the branch called master then use the web interface and "git branch" to confirm.
In Gitlab version v11.4.4-ee, you can:
Click me
Settings > Repository > Default Branch
For GitLab 11.5.0-ee, go to
https://gitlab.com/<username>/<project name>/settings/repository
.
You should see:
Default Branch
Select the branch you want to set as the default for this project. All merge requests and commits will automatically be made against this branch unless you specify a different one.
Click Expand, select a branch, and click Save Changes.