Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

remove deleted remote branches locally

git fetch -p && for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'); do git branch -D $branch; done
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #deleted #remote #branches #locally
ADD COMMENT
Topic
Name
2+6 =