Posted 05/07/2025
This post lists common Git cleanup commands for removing local branches and clearing stashes.
WARNING: These operations are destructive and cannot be undone.
For example delete all branches which has ‘feature/’ in name.
git branch -D $(git branch --list '*feature/*')
Explanation:
Delete all stashed changes:
git stash clear
git stash list
git stash drop stash@{0}