When you create a repository on GitHub with content, the repository is initialized with a single branch, called the default branch. The default branch is the base branch in your repository, against which all pull requests and code commits are automatically made, unless you specify a different branch. If you have more than one branch in your repository, anyone with admin rights over a repository can select one of these existing branches as the default branch on the repository.
Note: To set the default branch you must have more than one branch in your repository.
- On GitHub Enterprise, navigate to the main page of the repository.
- Under your repository name, click
- In the left menu, click Branches.
- In the default branch drop-down, choose the new default branch.
- Click Update.
You can only switch between branches that already exist on your GitHub Enterprise Server instance. To create a new branch through the UI, see "Creating and deleting branches within your repository".