Delete all git local branches
Posted: 3 Feb 2021, 2:59am - Wednesday

I was wondering how to delete all local git branch in Windows. But I didn't bother as I realized I got Cygwin anyway so I just took the Linux one... :) So I write a bash script named "clean_git.sh" with this contents:

#!/bin/bash
git checkout master
# git pull - optional
git status
git branch | grep -v "master" | xargs git branch -D

Cheers!