This version of GitHub Enterprise will be discontinued on This version of GitHub Enterprise was discontinued on 2020-11-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 the automatic deletion of branches

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

Did this doc help you?

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Or, learn how to contribute.

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

Did this doc help you?

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Or, learn how to contribute.