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

how to delete all branches in git except master

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

PREVIOUS NEXT
Code Example
Shell :: apt-key export import 
Shell :: check lines of code in a folder 
Shell :: delete all stopped docker containers 
Shell :: install drush ubuntu 20.04 
Shell :: error commit is a merge but "no -m" option 
Shell :: rmdir directory not empty windows 
Shell :: apt vs homebrew 
Shell :: push new branch to remote 
Shell :: stop npm server cmd 
Shell :: show conflicts git 
Shell :: does git bash have bashrc 
Shell :: how to set up git in linux terminal 
Shell :: tmux kill-session by name 
Shell :: installing docker on amazon linux 
Shell :: docker: Error response from daemon: pull access denied for 
Shell :: install tmux fedora 
Shell :: git restore all 
Shell :: linux grep recursive 
Shell :: bash blackeye 
Shell :: Go install /linux 
Shell :: uvicorn ERROR: [Errno 98] Address already in use 
Shell :: osx kill process on port 
Shell :: linux get lines in file 
Shell :: unable to locate package ubuntu 
Shell :: webgl server apache 
Shell :: git how to remove git 
Shell :: ionic cordova sign apk 
Shell :: git clone to path 
Shell :: git clone command 
Shell :: fix read only file system 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =