Skip to content

Instantly share code, notes, and snippets.

@aitoroses
Created May 26, 2014 10:29
Show Gist options
  • Save aitoroses/5cd922b39a74a4e2e3b4 to your computer and use it in GitHub Desktop.
Save aitoroses/5cd922b39a74a4e2e3b4 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