From 66976fd0312eab3f8eea41c984a0d631d763fc1d Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 10 Jan 2025 13:17:03 +0000 Subject: killmerged with custom remote --- .bash_profile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.bash_profile b/.bash_profile index 69caecd..c6f4d6e 100644 --- a/.bash_profile +++ b/.bash_profile @@ -45,10 +45,11 @@ function pm() { } function killmerged() { - for b in $(git branch --merged HEAD --no-contains HEAD|grep -vE 'stage|master|svn|develop|uat'); do + local remote="${1:-origin}" + for b in $(git branch --merged HEAD --no-contains HEAD|grep -vE 'stage|master|svn|develop|uat|stable'); do b="${b##+( )}" b="${b%%+( )}" - git branch -d $b && git push origin :$b + git branch -d $b && git push "$remote" :$b done } -- cgit v1.2.3