Automatically prune on fetch
git config --global fetch.prune true
It sets a global Git config so every git fetch will prune stale remote-tracking branches—i.e., it automatically deletes local refs like origin/foobar when they’ve been removed from the remote.