Change Default branch in gitlab

前端 未结 13 2096
[愿得一人]
[愿得一人] 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 19:56

    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.

    0 讨论(0)
  • 2020-12-07 20:00

    in the GitLab Enterprise Edition 12.2.0-pre you have to use following: SettingRepositoryDefault Branch ( expand it) and change the default branch Here

    0 讨论(0)
  • 2020-12-07 20:05

    To change default branch in GitLab:
    1. Settings > General > General project settings > Expand
    2. Default Branch > Change your project default branch
    3. Save changes

    0 讨论(0)
  • 2020-12-07 20:08
    1. Settings
    2. General
    3. General Project Settings

    Setting the default branch

    0 讨论(0)
  • 2020-12-07 20:08

    In the latest GitLab Community Edition version 9.2.2.:

    1. You have to click on 'Settings' tab located at right most on tabs panel after opening the project.
    2. Under 'Settings' you will get section 'Default Branch' dropdown which will give you all branches for the repository. Select the desired branch.
    3. Scroll down to hit green colored 'Save changes' button located just after 'Project Avatar'.

    Please refer image below:

    0 讨论(0)
  • 2020-12-07 20:09

    To change the default branch in Gitlab 7.7.2:

    • Click Settings in the left-hand bar
    • Change the Default Branch to the desired branch
    • Click Save Changes.
    0 讨论(0)
提交回复
热议问题