Skip to content

Instantly share code, notes, and snippets.

@bobthecow
Created June 4, 2010 15:49
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 bobthecow/425576 to your computer and use it in GitHub Desktop.
Save bobthecow/425576 to your computer and use it in GitHub Desktop.
Best git alias ever!
[alias]
alias = "!sh -c '[ $# = 2 ] && git config --global alias.\"$1\" \"$2\" && exit 0 || [ $# = 1 ] && [ $1 = \"--list\" ] && git config --list | grep \"alias\\.\" | sed \"s/^alias\\.\\([^=]*\\)=\\(.*\\).*/\\1@@@@=>@@@@\\2/\" | sort | column -ts \"@@@@\" && exit 0 || echo \"usage: git alias <new alias> <original command>\\n git alias --list\" >&2 && exit 1' -"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment