Back

How I Git

3 November, 2025


This is basically so I don't forget things.

Pruning branches

I use git branch a lot, to check branch names before switching to them, and I really hate it when the list is clogged up with 20+ old branches. So I regularly run this:

git fetch --prune | git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -d