Nice looking Git log

twitter logo ・1 min read

One of the most used git command is git log which shows commit logs.

$ git log

I found custom git lg looks more self-sufficient and descriptive. If you want to have this command follow next instruction.

Following image shows what's the difference between custom git lg and git log --oneline.


Go to C:\Users\YOURUSERNAME and add code in .gitconfig file:

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

That's it!

From now on you can call git lg and have new view in terminal. Enjoy!

twitter logo DISCUSS (16)
markdown guide

Cool tip.

I am on Linux, and I use the OhMyZsh shell that have already pretty print alias for git log, and for example the glg one looks like:


$ alias | grep glg -
glg='git log --stat'
glgg='git log --graph'
glgga='git log --graph --decorate --all'
glgm='git log --graph --max-count=10'
glgp='git log --stat -p'

I don't work on Linux but anyway it always good to know other solutions


The alias I have in Linux should work in Windows to, just give it a try... define them in the same way you have define the one in this article.


I personally prefer CLI for things like git. I've had too many bad experiences in the past with gui tools. I feel safer knowing exactly what commands I'm issuing


Agree with you. I had such cases too, for ex. Sourcetree sometimes didn't want to launch at all. It sucks.

Sourcetree is terrible don't use that. If you’re on Windows or Mac give Git Fork a try. I used Sourcetree before I loved how it looked and how simple it was but it was slow and buggy it actually made me switch to command line. I just don’t like typing out the commands all the time.

I love Sourcetree. It got better. For cherry picking very handy.


There's a button on Git Fork that shows you what commands it's calling underneath.


Never heard of it before. Tried all the others like tower, kraken etc. and settled on sourcetree. Haven't had issues, but I will give fork a try.


I swear every time I open DEV there's an article on the homepage that's relevant to what I'm looking for in the moment.

Super nice alias, thanks!


Good to know that you found what you was looking for. Welcome!


If you're into colorful tools (and who's not, right?), I recommend having a look at tig. 🚀

Classic DEV Post from May 6

The state of GraphQL

The report about the state of GraphQL base on the partial data gathered during the annual "The State of JavaScript" survey

Amal Tapalov profile image
I am a self-taught Frontend Developer. I like building functional and beautiful websites. Now I'm keen on Javascript and React. Also I write about useful hacks and web development.