From 2059668718e35e7d50387b57e036a0a6627f2b5a Mon Sep 17 00:00:00 2001 From: desktop Date: Wed, 15 Nov 2023 16:57:39 +0300 Subject: [PATCH] git : add gbda to delete all local branches except for the current one. --- .README.md | 1 + .linux/bash/module/git.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/.README.md b/.README.md index 0dcd113..6027cb5 100644 --- a/.README.md +++ b/.README.md @@ -513,6 +513,7 @@ Command|Description `gchb`|Git checkout branch. `gb`|Git branch. `gbd [BRANCH]`|Delete specified Git branch. +`gbda`|Delete all local branches except the current one. `gf`|Git fetch --all. `gt`|Git tag. `gi`|Delete files updated in git ignore. diff --git a/.linux/bash/module/git.sh b/.linux/bash/module/git.sh index f667d21..b5eba06 100644 --- a/.linux/bash/module/git.sh +++ b/.linux/bash/module/git.sh @@ -11,6 +11,7 @@ alias gch="git checkout" alias gchb="git checkout -b" alias gb="git branch --all" alias gbd="git branch -D" +alias gbda="git branch | grep -v ^* | xargs git branch -D" alias gf="git fetch --all -v -p" alias gt="git tag" alias gi="git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached"