티스토리 뷰

728x90

 

alias gbrd='git co main && git pull && git branch | egrep -v "(main|master|release)" | xargs git branch -D'
alias gbrdr='git co release && git pull origin release && git pull origin main && git branch | egrep -v "(main|master|release)" | xargs git branch -D'


git branch | egrep -v "(main|master|release)" | xargs git branch -D

https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/delete-all-branches-except-master-main-local-remote

 

How to delete all Git branches except master or main exampleb | TheServerSide

When an exhaustive sprint comes to an end, or a milestone release makes its way out the door, a cleanup routine many developers like to perform is the deletion of all Git branches except the master or main branch in the local repository. Often this task is

www.theserverside.com

 

728x90
댓글