Skip to content

Instantly share code, notes, and snippets.

@abatilo
Created May 12, 2017 17:18
Show Gist options
  • Save abatilo/c500381a6fb18b7e29cbe3166d77c084 to your computer and use it in GitHub Desktop.
Save abatilo/c500381a6fb18b7e29cbe3166d77c084 to your computer and use it in GitHub Desktop.
# Deletes local branches if they don't exist on the remote
alias prune=`git fetch --prune --all && 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