Branches are central to collaboration on GitHub Enterprise, and the best way to view them is the branches page.
On GitHub Enterprise, navigate to the main page of the repository.
Above the list of files, click NUMBER branches.
-
Use the navigation at the top of the page to view specific lists of branches:
- Your branches: In repositories that you have push access to, the Yours view shows all branches that you’ve pushed to, with the most recent branches first.
- Active branches: The Active view shows all branches that anyone has committed to within the last three months, ordered by the branches with the most recent commits first.
- Stale branches: The Stale view shows all branches that no one has committed to in the last three months, ordered by the branches with the oldest commits first. Use this list to determine which branches to delete.
- All branches: The All view shows the default branch, followed by all other branches ordered by the branches with the most recent commits first.
Searching branches
Use the search box to get a list of branches by specific name.
Deleting branches
You can delete branches that don't have open pull requests, and that do not have open pull requests that rely on the branch (such as pull requests that target the branch, for example). Note that you can only delete branches if you have push access to the repository that contains them.
You can also delete branches from within pull requests. For more information see Deleting unused branches
On GitHub Enterprise, navigate to the main page of the repository.
Above the list of files, click NUMBER branches.
On the right-hand side of the branch you wish to delete, click .
If you mistakenly delete a branch, you can immediately click Restore after deleting it to bring it back.
If you refresh the page, the Restore button will disappear. If the branch never had any pull requests associated with it, you will need to push the branch up again from the command line. If the branch had a pull request, you can navigate to the pull request and click Restore from there.