git delete all branches except some code example Example: git branch delete all local branches // hard delete git branch -D $(git branch)