Skip to content

Instantly share code, notes, and snippets.

@BibMartin
Last active April 12, 2024 20:13
Show Gist options
  • Save BibMartin/3d8bc449ca2f93d4cf90 to your computer and use it in GitHub Desktop.
Save BibMartin/3d8bc449ca2f93d4cf90 to your computer and use it in GitHub Desktop.
git config --global alias.lola "log --graph --decorate --pretty=oneline --abbrev-commit --all"
@vishalgoyall
Copy link

Could you please tell me the argument to show "committer's name" as well?

@altoidbox
Copy link

Something like this might do what you want. You can of course change the color, remove the date (%ad), or change the date format (--date) to match what you want. The format specifiers are documented at https://git-scm.com/docs/git-log#_pretty_formats.

git log --graph --pretty='format:%C(auto)%h %d %s %C(green)%an%C(bold blue) %ad' --all --date=relative

The %an format specifier is for the author name (%cn would be the committer name).

@nicoLedesma
Copy link

So, this could be a good option:

git config --global alias.lola "log --graph --decorate --pretty='format:%C(auto)%h %d %s %C(green)%an%C(bold blue) %ad' --abbrev-commit --all --date=relative"

It works very well for me.

@altoidbox
Copy link

Yep. I've since tweaked my to:

git log --graph --pretty='format:%C(auto)%h %d %s %C(green)(%ad) %C(cyan)<%an>' --abbrev-commit --all --date=relative

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