News for hackers. Stuff that matters.
Re:Git tips from the trenches by kbar13 on Sunday February 02, 2014 @11:52AM (#7166536)
> $ git branch --merged | xargs git branch -d

  does this actually work? `git branch --merged` for me also 
  returns '* master', which when xarg'd would include the '*'
  and also 'master'. I don't want to delete master, and I
  certainly dont want to delete * if it globs.
EDIT: made this into a code block as I have no idea how to make asterisks display.
Re:Git tips from the trenches by ochronus on Sunday February 02, 2014 @12:06PM (#7166587)
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'

Re:Git tips from the trenches by click170 on Sunday February 02, 2014 @02:46PM (#7167216)
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
Re:Git tips from the trenches by mef on Sunday February 02, 2014 @11:56AM (#7166552)
It'll be fine, git will refuse to delete the branch you're on and the loop will continue:

error: Cannot delete the branch 'master' which you are currently on.