We often get to a point where we have billions of local git repositories that have been merged already, or abandoned - it’s often difficult to see the wood from the trees.
Prune remote tracking branches
This only deletes the remote references to these branches,
if they have been deleted on
origin - it doesn’t delete them locally.
It does however clean-up views you get of the current code, and removes some git cruft locally.
Delete local branches that have been merged
This command lists your merged branches in Vim, and allows you to remove the ones you wish to keep (notably
Save and exit that temp file to then locally prune all the merged branches.
Garbage collect loose ends
Read more about
git gc here.
A simple run through of any unreferenced objects and unnecessary files to speed up merges and pushes.
You’re supposed to run this ‘regularly’, apparently…