Skip to content

Cleaning House

In the past month I've done a lot of traveling. Traveling means noodling - lots of topic branches laying around from airplane rides and hotel hacking. Today I decided to…

Author

In the past month I’ve done a lot of traveling. Traveling means noodling – lots of topic branches laying around from airplane rides and hotel hacking. Today I decided to get rid of the topic branches which had been merged into master. But how?

When in doubt, ask Scott Chacon. Here’s how to delete all the branches which are a subset of master (and therefor contain nothing juicy):

git branch --contains master | grep -v master | xargs git branch -d

Explore more from GitHub

Company

Company

The latest on GitHub, from GitHub.
GitHub Universe 2024

GitHub Universe 2024

Get tickets to the 10th anniversary of our global developer event on AI, DevEx, and security.
GitHub Copilot

GitHub Copilot

Don't fly solo. Try 30 days for free.
Work at GitHub!

Work at GitHub!

Check out our current job openings.