Cleaning up old remote git branches

First, what is the result of git branch -a on machine B?

Second, you have already deleted heads/devel on origin, so that’s why you can’t delete it from machine B.


git branch -r -d origin/devel


git remote prune origin


git fetch origin --prune

and feel free to add --dry-run to the end of your git statement to see the result of running it without actually running it.

Docs for git remote prune and git branch.

Leave a Comment