Fellow neat-freaks! Add this to your .bash_profile and thank me later. alias gcmb="git branch --merged | grep -Ev '(^\*|master)' | xargs git branch -d" It cleans all branches you’ve got locally that have already been merged.
Replying to @captainsafia
1- Aliases are poor practice. Use functions. 2- You forgot the -r option to xargs. 3- you're matching any branch that contains "master", that's wrong. So you should use: gcmb () { git branch --merged | grep -Ev '^(\*| master$)' | xargs -r git branch -d ;} Thanks for the tip!
5:37 PM - 5 Nov 2018
0 replies
0 retweets
2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Read my blog!