Skip to content

Instantly share code, notes, and snippets.

@ClaudioVarandas
Created March 8, 2017 10:03
Show Gist options
  • Save ClaudioVarandas/18965c6c58d5f25d111d9ea952f2dffb to your computer and use it in GitHub Desktop.
Save ClaudioVarandas/18965c6c58d5f25d111d9ea952f2dffb to your computer and use it in GitHub Desktop.
Git tricks
#How to prune local tracking branches that do not exist on remote anymore
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