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

how to delete all branches in git except master

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

git delete all local branches starting with

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

PREVIOUS NEXT
Code Example
Shell :: change commit author 
Shell :: optimize github repo 
Shell :: install wkhtmltopdf linux command 
Shell :: golang 
Shell :: iptables deny all 
Shell :: manjaro nvidia driver 
Shell :: print last terminal commands 
Shell :: sequelize installation 
Shell :: How to install p12 certificate in ubuntu 
Shell :: YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. Invalid release/repo/arch combination/ 
Shell :: cudatoolkit installation 
Shell :: () vs {} bash 
Shell :: how to kill a process in powershell 
Shell :: how to remove user from the group 
Shell :: Check for process and kill if running Linux 
Shell :: unable to connect my bluetooth devices to kali linux 
Shell :: ubuntu reset path 
Shell :: ls all files including hidden powershell 
Shell :: create a branch from main 
Shell :: heroku pg kill 
Shell :: count the numbers of directories in a specific directory 
Shell :: add local repository to remote 
Shell :: dockerfile default workdir 
Shell :: delete pid port 
Shell :: check packages in macos 
Shell :: microsoft excel free download for ubuntu 
Shell :: kill port 3000 ubuntu 
Shell :: vscode kali linux 
Shell :: delete git branch remote 
Shell :: grep search text in folder 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =