Skip to content

Instantly share code, notes, and snippets.

@bakpa79
Created March 6, 2020 18:32
Show Gist options
  • Select an option

  • Save bakpa79/0161f9a9d8822a02a30934600bfffad4 to your computer and use it in GitHub Desktop.

Select an option

Save bakpa79/0161f9a9d8822a02a30934600bfffad4 to your computer and use it in GitHub Desktop.
Good looking Git logs using an alias
Found here: https://coderwall.com/p/euwpig/a-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
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"
And every time you need to see your log, just type in
git lg
Or, if you want to see the lines that changed
git lg -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment