Harry Wolff

You can't escape my laugh.

Prune Remote Git Branches

Git is a wonderful version control system. It’s light, nimble, and fast. It makes managing code amongst many developers a dream.

Unfortunately it has a fair share of quirks.

One of the quirkiest quirks that I’ve run into a couple times now is an issue with remote git branches.

When a remote git branch is deleted from the server your local repository doesn’t update its references.

The easy solution is to run this command:

git remote prune origin

This prunes and removes all remote branches that no longer exist.

Full credit to Dmytro Shteflyuk for this tip.