Skip to content

Instantly share code, notes, and snippets.

@jessesquires
Last active August 9, 2024 13:43
Show Gist options
  • Save jessesquires/d0f3fc99be8208394a450ce86443ce7d to your computer and use it in GitHub Desktop.
Save jessesquires/d0f3fc99be8208394a450ce86443ce7d to your computer and use it in GitHub Desktop.
git "smartlog" / "pretty log"
# blog post
#
# https://www.jessesquires.com/blog/customizing-git-log/
git log --graph --pretty=format:'commit: %C(bold red)%h%Creset %C(red)<%H>%Creset %C(bold magenta)%d %Creset%ndate: %C(bold yellow)%cd %Creset%C(yellow)%cr%Creset%nauthor: %C(bold blue)%an%Creset %C(blue)<%ae>%Creset%n%C(cyan)%s%n%Creset'
@orta
Copy link

orta commented Jul 31, 2017

Screenshot for those interested

screen shot 2017-07-31 at 12 01 19

@algal
Copy link

algal commented Jul 31, 2017

It's beautiful!

FWIW, I've been living off this one for a while, which I think I got on SO:

git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%Cblue%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"

It's one line per commit, with tags, commuter name, graph structure, and colorization.

@muffins
Copy link

muffins commented Mar 4, 2019

Thank you <3

@jd-nuva
Copy link

jd-nuva commented Dec 3, 2023

thanks and this is what I search for every time i setup a new devserver

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