Git Tips: Remove tracking branches no longer on remote
My colleage Joe asked me tonight, "how to remove those branches that no longer exist on remote?"
In short, you have two options
- run
git remote prune origin
at times - run
git config --global fetch.prune true
command to config your git to delete those branches every time when you rungit fetch
I prefer the second option, how about you?