This site runs best with JavaScript enabled.Automatically Delete Branches After Merging Pull Requests

Automatically Delete Branches After Merging Pull Requests

March 25, 2020


We create branches for new features, bugfixes, doc changes and other things. It's easy to forget to delete them after they get merged. Instead of having to remember to delete them, what if you could do it automatically?

Good news - you can!

Here's how you can do it too:

  1. Go to your repo's homepage on GitHub
  2. Click on the "Settings" tab
  3. Scroll to the "Merge button" section
  4. Check the box for "Automatically delete head branches"

Now after you merge a pull request, the head branch will automatically be deleted.

Hooray! That's it :)

Discuss on TwitterEdit post on GitHub

Share article

Join the Newsletter

I send an email or two per month to share things I'm excited about. I'd be delighted if you signed up.



Help others learn to code