This site runs best with JavaScript enabled.

Automatically Delete Branches After Merging Pull Requests

March 25, 2020

––– views

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 a couple emails per month related to programming and learning. I also share goodies and deals here.

Help others learn to code