Joe PreviteJoe PreviteSee all posts

Automatically Delete Branches After Merging Pull Requests

Last updated:

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 :)