Skip to content

Instantly share code, notes, and snippets.

View fajarmf's full-sized avatar

Fajar Maulana Firdaus fajarmf

View GitHub Profile
@fajarmf
fajarmf / cleanup_branch.sh
Created September 13, 2016 07:38
Cleanup local branch that doesn't have remote upstream. Most of the time due to PR squash
git fetch --prune; diff --new-line-format="" --unchanged-line-format="" <(git branch | grep -v master | grep -v "*" | sort) <(git branch -r | awk '{print $1}' | awk '{sub("origin/", ""); print $0}' | sort) | xargs git branch -D