DekGenius.com
SHELL
delete all local branches git
$ git branch | grep -v "master" | xargs git branch -D
git delete all branches except master
git branch | grep -v "master" | xargs git branch -D
delete all local branches git
git branch --merged | grep -v * | xargs git branch -D
Git delete all branches except master
// -- Clear all branches except Master Branch --
git branch -D $(git branch | grep -v 'master')
// This will clear all your branches you have on local that you have
// not pushed to your repository. eg: IF, you created a branch that was,
// not pushed it will remain along with amster.
// But the others will be cleaned.
// -- Delete a single branch
git branch -D branch-name
Remove all your local git branches but keep master
git branch | grep -v “master” | xargs git branch -D
delete all local branches except current branch
git branch | grep -v "master" | grep -v ^* | xargs git branch -D
git branch delete all local branches
// hard delete
git branch -D $(git branch)
how to delete all branches in git local
git branch | grep -v "main" | xargs git branch -D
remove all branch local git
git branch | grep -v "develop" | grep -v "master" | xargs git branch -D
git delete all local branches starting with
git branch --list 'o*' | xargs -r git branch -d
Deleting all the git local branches
git branch --all-branches --merged --delete --ignore="fix-this-bug,prefix-*"
git delete all local branches
git for-each-ref --format '%(refname:short)' refs/heads | grep -v master | xargs git branch -D
© 2022 Copyright:
DekGenius.com