Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git delete all branches except master

git branch | grep -v "master" | 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 remove all branches except master windows

git branch | %{ $_.Trim() } | ?{ $_ -ne 'master' } | %{ git branch -D $_ }
Comment

git delete all remote branches except master

git branch -r | grep 'origin' | grep -v 'master$' | grep -v HEAD | cut -d/ -f2- | while read line; do git push origin :heads/$line; done;
Comment

how to delete all branches in git except master

$ git branch | grep -v '^*' | xargs git branch -D
Comment

PREVIOUS NEXT
Code Example
Shell :: refresh bash_profile 
Shell :: bash endless loop 
Shell :: install google chrome ubuntu 
Shell :: dotnet build release 
Shell :: install tkinter conda 
Shell :: certbot remove domain 
Shell :: composer install drush 
Shell :: check active ssh connections on linux 
Shell :: winehq-stable : Depends: wine-stable (= 5.0.1~bionic) 
Shell :: Warning: os-prober will not be executed to detect other bootable partitions. Systems on them will not be added to the GRUB boot configuration. 
Shell :: how to install pip2 in kali linux 
Shell :: install postman in linux 
Shell :: linux ram size 
Shell :: find saved wifi password in linux 
Shell :: como actualizar node en ubuntu 
Shell :: firebase-tools npm 
Shell :: install yarn with npm 
Shell :: "python -m venv venv" 
Shell :: find out which procses is using port linux 
Shell :: git submodule update init 
Shell :: conda install selenium 
Shell :: upgrade streamlit 
Shell :: how to remove git initialization 
Shell :: delete all docker images 
Shell :: install nodemon globally 
Shell :: Module build failed: Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (79) 
Shell :: uninstall vscode linux 
Shell :: netstat listening port 8080 mac 
Shell :: keras version install in colab 
Shell :: certbot renew 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =