Skip to content

Instantly share code, notes, and snippets.

@CanerPatir
Created April 5, 2021 11:01
Show Gist options
  • Select an option

  • Save CanerPatir/9aac54d640500daa8afab666b46d37fa to your computer and use it in GitHub Desktop.

Select an option

Save CanerPatir/9aac54d640500daa8afab666b46d37fa to your computer and use it in GitHub Desktop.
remove-untracking-remote-for-all
#!/bin/zsh
for i in */.git;
do ( echo $i; cd $i/..; git pull; git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done );
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment