Skip to content

Instantly share code, notes, and snippets.

@dyllanwli
Created July 28, 2020 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dyllanwli/e5c8e1d26d5510353a861e5969175ceb to your computer and use it in GitHub Desktop.
Save dyllanwli/e5c8e1d26d5510353a861e5969175ceb to your computer and use it in GitHub Desktop.
Clear local branch not exists in remote
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment