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

  1. On GitHub Enterprise, navigate to the main page of the repository.

  2. Above the list of files, click NUMBER branches. Branches link on overview page

  3. 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 pushed to within the last three months, ordered by the most recently pushed branches first.
    • Stale branches: The Stale view shows all branches that no one has pushed to in the last three months, ordered by the least recently pushed branch first. Use this list to determine which branches to delete.
    • All branches: The All view shows the default branch, followed by all other branches with the most recently pushed branch first. The branches page for the Atom repository

Searching branches

Use the search box to get a list of branches by specific name.

Searching branches

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

  1. On GitHub Enterprise, navigate to the main page of the repository.

  2. Above the list of files, click NUMBER branches. Branches link on overview page

  3. On the right-hand side of the branch you wish to delete, click . Deleting a branch

If you mistakenly delete a branch, you can immediately click Restore after deleting it to bring it back.

Restoring a deleted branch

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.