2 comments

[ 3.0 ms ] story [ 12.4 ms ] thread
Useful article for pruning merged branches, but this title is misleading and link-bait.

The actual title on the blog post is "Cleaning Up Git Branches", which is much more appropriate for an article that uses 5 commands including potentially fragile grepping and regex's to get the job done.

Ah, I see at the very bottom of the post is the "one command", in the form of an alias:

  alias gitpurge=" \
    git checkout master && \
    git remote update --prune | \
    git branch -r --merged | \
    grep -v master | \
    sed -e 's/origin\//:/' | \
    xargs git push origin"