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

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 :: how to uncommit the last commit in git 
Shell :: update submodule 
Shell :: how to install apt 
Shell :: install mongo ubuntu 20.04 
Shell :: ionic capacitor motion 
Shell :: chmod just directories 
Shell :: install faiss in colab 
Shell :: conda install cairo 
Shell :: install docker desktop on server 2019 
Shell :: git push and pull not asking password 
Shell :: dart 
Shell :: wslconfig example 
Shell :: grep not match 
Shell :: ldap query powershell 
Shell :: clipboard manager linux unity 
Shell :: arch linux pacman cannot install 
Shell :: windows start service 
Shell :: rpm extract 
Shell :: revert git add 
Shell :: ubuntu check available packages 
Shell :: user.signingkey git 
Shell :: composer for windows 
Shell :: fedora linux 
Shell :: start docker 
Shell :: how to install yagmail 
Shell :: socket install 
Shell :: git config --global http.sslverify "false" This command resolve my problem 
Shell :: git clone permission denied 
Shell :: shell curl extract bearer token from response 
Shell :: linux kill process 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =