Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

git clean branches

git checkout main
git branch -D $(git branch | grep -v 'main') # delete all local but main
git fetch # fetch from origin
git remote prune origin # delete non-existent remote branches
git pull # get to latest on main
 
PREVIOUS NEXT
Tagged: #git #clean #branches
ADD COMMENT
Topic
Name
2+5 =