- Delete all local git branches except current
git branch --list | grep -v "^* $(git branch --show-current)$" | xargs git branch -D
- Clean up GIT repository
git reflog expire --expire=now
git prune
git lfs prune
git gc
git branch --list | grep -v "^* $(git branch --show-current)$" | xargs git branch -D
git reflog expire --expire=now
git prune
git lfs prune
git gc