Are you sure you want to delete this access key?
title | intro | permissions | versions | redirect_from |
---|---|---|---|---|
Changing the default branch | If you have more than one branch in your repository, you can configure any branch as the default branch. | People with admin permissions to a repository can change the default branch for the repository. | [{free-pro-team *} {enterprise-server *} {github-ae *}] | [/github/administering-a-repository/setting-the-default-branch /articles/setting-the-default-branch] |
You can choose the default branch for a repository. The default branch is the base branch for pull requests and code commits. For more information about the default branch, see "About branches."
{% if currentVersion != "github-ae@latest" %} {% note %}
Note: If you use the Git-Subversion bridge, changing the default branch will affect your trunk
branch contents and the HEAD
you see when you list references for the remote repository. For more information, see "Support for Subversion clients" and git-ls-remote in the Git documentation.
{% endnote %} {% endif %}
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}
You can also rename the default branch. For more information, see "Renaming a branch."
{% endif %}
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}
{% data reusables.branches.set-default-branch %}
{% endif %}
To change the default branch, your repository must have more than one branch. For more information, see "Creating and deleting branches within your repository."
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" or currentVersion == "github-ae@latest" %}
{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} {% data reusables.repositories.repository-branches %}
{% else %}
{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} {% data reusables.repositories.repository-branches %}
{% endif %}
Press p or to see the previous file or, n or to see the next file
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?