How to clean up stale Git branches (local & remote) in minutes
Over time, branches accumulate, they get merged, abandoned, or deleted remotely but still present locally.
Short on time? Here’s the TL;DR:
git fetch --prune # Sync + remove deleted remote branches
git branch -vv # Find stale branches ([gone])
git branch -d branch_name # Delete them safely