👋 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.
Article version: Enterprise Server 2.20

Managing the automatic deletion of branches

You can have head branches automatically deleted after pull requests are merged in your repository.

Were you able to find what you were looking for?

Anyone with admin permissions to a repository can enable or disable the automatic deletion of branches.

  1. On GitHub Enterprise, navigate to the main page of the repository.
  2. Under your repository name, click Settings.
    Repository settings button
  3. Under "Merge button", select or unselect Automatically delete head branches.
    Checkbox to enable or disable automatic deletion of branches

Further reading

Were you able to find what you were looking for?

Ask a human

Can't find what you're looking for?

Contact us