Skip to content

Instantly share code, notes, and snippets.

@rufus2021
Last active December 15, 2015 17:28
Show Gist options
  • Save rufus2021/135be77a40cbb732c714 to your computer and use it in GitHub Desktop.
Save rufus2021/135be77a40cbb732c714 to your computer and use it in GitHub Desktop.
delete all local branches and save master and develop
git br | grep -Ev 'develop|master' | xargs git br -D // brute force
git br | grep -Ev 'develop|master' | xargs git br -d // preserver unmerged branches
@pgoldrbx
Copy link

also helpful:

delete all local branches that have been merged

git branch --merged | xargs git branch -d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment