Change Default branch in gitlab

前端 未结 13 2153
[愿得一人]
[愿得一人] 2020-12-07 19:35

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

13条回答
  •  伪装坚强ぢ
    2020-12-07 20:16

    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.

提交回复
热议问题