👋 We've unified all of GitHub's product documentation in one place! Check out the content for REST API, GraphQL API, and Developers. Learn more on the GitHub blog.

This version of GitHub Enterprise will be discontinued on This version of GitHub Enterprise was discontinued on 2020-08-20. 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.

Article version: Enterprise Server 2.18

Creating and deleting branches within your repository

You can create or delete branches directly on GitHub Enterprise.

In this article

Creating a branch

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

  2. Optionally, if you want to create your new branch from a branch other than the default branch for the repository, click NUMBER branches then choose another branch:

    Branches link on overview page

  3. Click the branch selector menu.

    branch selector menu

  4. Type a unique name for your new branch, then select Create branch.

    branch creation text box

Deleting a branch

You can't delete a branch if it's currently associated with an open pull request.

  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. Scroll to the branch that you want to delete, then click .
    delete the branch

For more information, see "About branches."

Further reading

Ask a human

Can't find what you're looking for?

Contact us