From 636c820a0da48c10e61e76eaf2780add6f1fe7af Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 24 Oct 2016 08:16:23 +0200 Subject: [PATCH] Remove branches when their remote was removed --- bin/git-ps | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/git-ps b/bin/git-ps index f3f5970..96371ec 100755 --- a/bin/git-ps +++ b/bin/git-ps @@ -23,3 +23,6 @@ for branch in $(git branch --merged | grep -v '^*'); do git branch -d ${branch} fi done + +step "Removing local branches where remote branch is gone..." +git branch -vv | awk '/: gone]/{print $1}' | xargs -r git branch -D