Skip to content

Instantly share code, notes, and snippets.

@AlexeyRaga
Forked from aitoroses/Better_git_log.md
Created May 26, 2014 10:36
Show Gist options
  • Save AlexeyRaga/aef96871f8dba055fcb3 to your computer and use it in GitHub Desktop.
Save AlexeyRaga/aef96871f8dba055fcb3 to your computer and use it in GitHub Desktop.

Better Git log

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

create an alias 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"

git lg

git lg -p

Otro

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

this will: -one commit per line

-show graph of commits

-abbreviated commit IDs

-dates relative to now

-show commit references (like git log --decorate)

-lots of colour

-show author of the commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment