Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

delete all local branches git

$ git branch | grep -v "master" | xargs git branch -D 
Comment

git delete all branches except master

git branch | grep -v "master" | xargs git branch -D
Comment

delete all local branches git

git branch --merged | grep -v * | xargs git branch -D 
Comment

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
Comment

Remove all your local git branches but keep master

git branch | grep -v “master” | xargs git branch -D
Comment

delete all local branches except current branch

git branch | grep -v "master" | grep -v ^* | xargs git branch -D
Comment

git branch delete all local branches

// hard delete

git branch -D $(git branch)
Comment

how to delete all branches in git local

git branch | grep -v "main" | xargs git branch -D
Comment

remove all branch local git

git branch | grep -v "develop" | grep -v "master" | xargs git branch -D
Comment

git delete all local branches starting with

git branch --list 'o*' | xargs -r git branch -d
Comment

Deleting all the git local branches

git branch --all-branches --merged --delete --ignore="fix-this-bug,prefix-*"
Comment

git delete all local branches

git for-each-ref --format '%(refname:short)' refs/heads | grep -v master | xargs git branch -D
Comment

PREVIOUS NEXT
Code Example
Shell :: git set origin 
Shell :: random hex chars bash 
Shell :: windows where are pip packages installed 
Shell :: uninstall multipass 
Shell :: ubunut log as root 
Shell :: how to tar 
Shell :: git add and remove 
Shell :: committed to wrong branch 
Shell :: show internet password 
Shell :: git tag delete 
Shell :: select ords version 
Shell :: image converter linux 
Shell :: how to enable port 80 in ubuntu 
Shell :: linux link file 
Shell :: how to make git commit in the past 
Shell :: git change commit 
Shell :: install appx package windows 
Shell :: install slack ubuntu/linux 
Shell :: upgrade docker compose windows 
Shell :: git clean fdx 
Shell :: git global noverify 
Shell :: ubuntu cmd time 
Shell :: Create Local Github Repo 
Shell :: push new branch to remote 
Shell :: microsoft excel free download for ubuntu 
Shell :: if -z in bash 
Shell :: how to install bootstrap in angular 11 
Shell :: node install mint 
Shell :: bash script to output a specific line of a file 
Shell :: windows install httpie 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =