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:
- Go to your repo's homepage on GitHub
- Click on the "Settings" tab
- Scroll to the "Merge button" section
- 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 :)