git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
Removes branches that are marked as remote on your machine, but dont exist on origin.
If it complains, replace -d with -D at the end.
-d
-D
Used after git fetch prune.
git fetch prune
It keeps branch list tidy and real.
excellent!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Removes branches that are marked as remote on your machine, but dont exist on origin.
If it complains, replace
-d
with-D
at the end.Used after
git fetch prune
.It keeps branch list tidy and real.
excellent!