If you have a git branch locally on your machine, and it gets merged and deleted on the remote, the next time you
git pull, it will not automatically clean it up. That remote branch will still appear as if it exists until you manually run
git pull --prune.
After running this manually hundreds of times, I finally got annoyed enough to see if there is a way to do this automatically, and there is! Run
git config fetch.prune true and now every
git fetch or
git pull will also clean up and prune those deleted branch references.
It's important to note this won't actually DELETE your local copy of the branch. It only deletes the remote reference to the deleted branch. But at least now you'll know an upstream branch was cleaned up, so you can decide if it's safe to delete on your end.