Sometimes my git branches end up looking something like this
…and its really hard to tell what I’ve already done and merged and what is still in progress. (I masked the names of the branches because this is actually what my local git repo looks like for a client).
I know I should probably just clean up after myself as I go along, but I always forget. Anyway, this command will clean up the cruft (but I always forget it, so, here I am writing it down):
git remote prune origin
Here’s the result
You can also do a test run to see what the prune command will do by adding the
‐‐dry-run
flag.