Hacker News new | ask | show | jobs
by henshao 599 days ago
"git delete gone branches" is a one liner that you can google. first stack overflow result gives you the answer:

    git remote prune origin
Why would you use this 50 line script to do the same?
1 comments

This only removes references to remote branches. See e.g. [0]. The command in OP operates on local branches.

[0] https://stackoverflow.com/questions/20106712/what-are-the-di...

Just for anyone else following along..you're right. Here it is.

    git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d