bash - Delete all local git branches - Stack Overflow

PHOTO EMBED

Fri Feb 12 2021 22:18:32 GMT+0000 (UTC)

Saved by @ayazahmadtarar #sh

git branch | grep -v "master" | xargs git branch -D
Explanation:

🛒 Get all branches (except for the master) via git branch | grep -v "master" command
👇 Select every branch with xargs command
💦 Delete branch with xargs git branch -D
content_copyCOPY

https://stackoverflow.com/questions/10610327/delete-all-local-git-branches