Skip to content

Instantly share code, notes, and snippets.

@CyrilFind
Created January 3, 2020 14:15
Show Gist options
  • Save CyrilFind/d1997b1dd3c5c4ada78f84b5cabdfa44 to your computer and use it in GitHub Desktop.
Save CyrilFind/d1997b1dd3c5c4ada78f84b5cabdfa44 to your computer and use it in GitHub Desktop.
git cleanup
[clean local]
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d
[clean remote]
git branch -r --merged | egrep -v "(^\*|master|dev)" | sed 's/origin\///' | xargs -n 1 git push --delete origin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment