Skip to content

Instantly share code, notes, and snippets.

@Omerr
Last active March 11, 2024 06:09
Show Gist options
  • Star 22 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save Omerr/8134a61b56ca82dd90e546e7ef04eb77 to your computer and use it in GitHub Desktop.
Save Omerr/8134a61b56ca82dd90e546e7ef04eb77 to your computer and use it in GitHub Desktop.
git lol - an alias to Git that shows the commit graph in a pretty format

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

To configure as an alias git lol:

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

@Moanrisy
Copy link

I have similar alias in my zsh, the different was

  • my commit in reversed (glolr, git lol reversed)
  • HEAD, master, origin/master and origin/HEAD have different color

alias glolr="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' --color | tac"

@Thagichu
Copy link

Very Very useful command, Thanks for sharing this

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