I want to remove all Xcode local git branches but keep main, not manually since I have hundreds.
CodePudding user response:
You can do :
cd <your project directory>
rm -rf .git
If you want add your remote repository again, you have to setup it again, but all your local branches will be deleted.
CodePudding user response:
To remove all Xcode local git branches but keep main with a single command:
git branch | grep -v "main" | xargs git branch -D