Article version: Enterprise Server 2.14

This version of GitHub Enterprise will be discontinued on This version of GitHub Enterprise was discontinued on 2019-07-12. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Managing branches in your repository

Whenever you propose a change in Git, you create a new branch. Branch management is an important part of the Git workflow. After some time, your list of branches may grow, so it's a good idea to delete merged or stale branches.

Setting the default branch

The default branch is considered the base branch in your repository, against which all pull requests and code commits are automatically made, unless you specify a different branch.

Viewing branches in your repository

Branches are central to collaboration on GitHub Enterprise, and the best way to view them is the branches page.

Deleting and restoring branches in a pull request

If you have write access in a repository, you can delete branches that are associated with closed or merged pull requests. You cannot delete branches that are associated with open pull requests.

Ask a human

Can't find what you're looking for?

Contact us