Skip to content

Instantly share code, notes, and snippets.

@khanlou
Last active July 7, 2021 08:08
Show Gist options
  • Save khanlou/cd4a28c3474e730213b1207e306a18fe to your computer and use it in GitHub Desktop.
Save khanlou/cd4a28c3474e730213b1207e306a18fe to your computer and use it in GitHub Desktop.
Clean up all merged branches

To clean up git, run:

git remote prune origin; git branch --merged | grep -v '^* master$' | grep -v '^  master$' | xargs git branch -d

If it doesn't like that because it thinks the repo is not there, change the remote from http://github.com to http://[email protected]

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