Skip to content

Instantly share code, notes, and snippets.

@TheSavior
Created February 10, 2016 02:23
Show Gist options
  • Save TheSavior/3967fb89907e8dc55109 to your computer and use it in GitHub Desktop.
Save TheSavior/3967fb89907e8dc55109 to your computer and use it in GitHub Desktop.
Git Aliases
[alias]
cleanup = "!git branch --merged | grep -v '\\*\\|master' | xargs -n 1 git branch -d && git remote prune origin"
cleanup-remote = "!git branch -r --merged | grep origin | grep -v '>' | grep -v master | xargs -L1 | cut -d"/" -f2- | xargs git push origin --delete"
old-branches = "!git for-each-ref --sort=committerdate --format='%1B[1;34m %(authordate:relative) %1B[m %(refname:short) %1B[1;32m%(authorname)%1B[m' refs/remotes"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment