Skip to content

Instantly share code, notes, and snippets.

@ebual
Created October 26, 2020 12:42
Show Gist options
  • Select an option

  • Save ebual/fe7894801942171018bdec7c4c0ae826 to your computer and use it in GitHub Desktop.

Select an option

Save ebual/fe7894801942171018bdec7c4c0ae826 to your computer and use it in GitHub Desktop.
Gitprune
alias gitpruneorigin="git remote update origin --prune >/dev/null 2>&1"
alias gitprune='gitpruneorigin && 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