Skip to content

Instantly share code, notes, and snippets.

@Fastjur
Last active June 19, 2017 14:05
Show Gist options
  • Save Fastjur/00e1e3ce67218533de9d206be5165af7 to your computer and use it in GitHub Desktop.
Save Fastjur/00e1e3ce67218533de9d206be5165af7 to your computer and use it in GitHub Desktop.
Remove all local git branches already merged in master
git remote prune origin && (git branch --merged master | grep -v 'master$' | xargs git branch -d)
@grappigegovert
Copy link

If you grep for "^master$" instead of "master$", you also catch branches that end in 'master' that are not master

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