To clear all your local branches (except master, main and current branch), run below at your git repo: npx git-clear-branch Your machine must have npx installed, which is included in newest NodeJS.