From b927372eeff2fb7b6fa8396563a1320a62c7b524 Mon Sep 17 00:00:00 2001 From: "Nabheet S. Sandhu" Date: Sat, 24 Jan 2026 17:43:29 -0700 Subject: [PATCH] feat(git): add alias for deleting all local branches that do not have a corresponding remote --- plugins/git/git.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 9ef60d69a..182235e61 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -129,6 +129,7 @@ alias gb='git branch' alias gba='git branch --all' alias gbd='git branch --delete' alias gbD='git branch --delete --force' +alias gbDnr="gbD \$(diff -B <(gb | sed 's,[[:space:]\*]*,,' | sort) <(gbr | sed 's,[[:space:]\*]*origin/,,' | sort) | sed -n 's/^< //p') 2> /dev/null || echo 'No branches found!!!'" # git branch force-delete no remote function gbda() { git branch --no-color --merged | command grep -vE "^([+*]|\s*($(git_main_branch)|$(git_develop_branch))\s*$)" | command xargs git branch --delete 2>/dev/null