Skip to content

Instantly share code, notes, and snippets.

@istarkov
Last active April 17, 2023 06:06
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 istarkov/ec0afd7dc2f4ec59a65ac5ad50d77cc8 to your computer and use it in GitHub Desktop.
Save istarkov/ec0afd7dc2f4ec59a65ac5ad50d77cc8 to your computer and use it in GitHub Desktop.
gitclean alias
# gitclean allows to work with multiple origins, cleans all deleteded aliases
alias gitclean="(git remote | xargs git remote prune) && git branch -vv | egrep '('\$(git remote | xargs | sed -e 's/ /|/g')')/.*: gone]' | 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