Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@avataru
Last active August 29, 2015 14:15
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 avataru/87a688b594ac6131299a to your computer and use it in GitHub Desktop.
Save avataru/87a688b594ac6131299a to your computer and use it in GitHub Desktop.
Git aliases

Better log
Usage: git lg (see log) or git lg -p (see changed lines)

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

Undo last commit (not pushed)
Usage: git undo

git config --global alias.undo "reset --soft HEAD~1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment