Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

Git - Delete all local branches where the remote branch was deleted

# Delete all remote tracking Git branches where the upstream branch has been deleted
alias git_prune="git fetch --prune && git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -d"
Source by about.gitlab.com #
 
PREVIOUS NEXT
Tagged: #Git #Delete #local #branches #remote #branch #deleted
ADD COMMENT
Topic
Name
7+6 =