My local branch list only grows. Git can tell me which of those branches are already merged, so I know which ones are safe to delete.
The docs say --merged lists only branches whose tips are reachable from a commit, HEAD if you do not name one. Name your main branch to be explicit:
git branch --merged main
The output is a plain list. The current branch is in it too, marked with a star, so do not delete that one by reflex:
* main
old-feature
Read the list, then delete what you recognise:
git branch -d old-feature
The -d variant is the careful one. Per the docs the branch must be fully merged in its upstream, or in HEAD if no upstream is set. Git refuses anything else:
error: the branch 'wip' is not fully merged.
If you are sure you want to delete it, run 'git branch -D wip'
Only -D forces it. It throws away commits that nothing else points to, so use it when you are sure.
Caveats: because -d compares against HEAD when there is no upstream, run it while you are on main. And a branch that was merged with a squash merge on the server will not show up, since its original commits are not reachable from main. For those, git branch --no-merged main lists what is left, and you check each one by hand before using -D.
Further reading: git-branch documentation