Skip to content

Instantly share code, notes, and snippets.

@ninja-webdev
Created March 5, 2020 02:50
Show Gist options
  • Save ninja-webdev/546af75ce9f7a0678ca7fd1645f4297c to your computer and use it in GitHub Desktop.
Save ninja-webdev/546af75ce9f7a0678ca7fd1645f4297c to your computer and use it in GitHub Desktop.
a better git log

Source: https://coderwall.com/p/euwpig/a-better-git-log

It's simple. Just type in:

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

I guess that's a bit too long, eh? Let's just make an alias. Copy and paste the line below on your terminal:

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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment