From 4ba4906c2aa0585a367b051dd6b6cd493478e78a Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Tue, 23 Dec 2014 15:40:51 -0700 Subject: [PATCH] add git branch cleanup helper and alias --- git/gitconfig | 1 + git/githelpers | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/git/gitconfig b/git/gitconfig index 6bc9c02..496df31 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -34,6 +34,7 @@ todo = grep --heading --break --ignore-case -e ' FIX: *' -e ' TODO: *' pr = "!source ~/.githelpers && get_pr" prd = "!source ~/.githelpers && del_pr" + brc = "!source ~/.githelpers && clean_branches" [merge] tool = vimdiff ff = true diff --git a/git/githelpers b/git/githelpers index f7682a0..39af463 100644 --- a/git/githelpers +++ b/git/githelpers @@ -60,3 +60,9 @@ del_pr() { git checkout - && git branch -D ${BRANCH} } +clean_branches() { + BRANCHES=`git branch | grep -v \*` + for i in ${BRANCHES}; do + git branch -d $i + done +} \ No newline at end of file