Re:Git tips from the trenches
by kbar13 on Sunday February 02, 2014 @11:52AM
(#7166536)
> $ git branch --merged | xargs git branch -d
EDIT: made this into a code block as I have no idea how to make asterisks display.
[ Parent
| on HN ]
Yeah, didn't think about that, could be tricky if you're on another branch. Nice catch!
Re:Git tips from the trenches
by icecreammatt on Sunday February 02, 2014 @01:49PM
(#7166971)
I have an alias that I have created that prevents the branch you are currently on or master from being deleted.
alias gclean='git remote prune origin; git branch --merged | grep -v -E "(\*|master)" | xargs -n 1 git branch -d'
I'm not sure, but I can tell you how I'd find out. I'd clone the repo to a different directory and try it out in that test environment. Then delete the it when I'm done. #gitFTW