Sitemap

Pretty Git log

1 min readMay 6, 2016

--

Press enter or click to view image in full size

Are you tired of scrolling page through page in your terminal to see your Git log? I am. So I did some googling and found a really great fix for this!

The magic snippet

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

Try it! This is the result.

Press enter or click to view image in full size

Looks great, doesn’t it? But it’s really a lot to remember and type. How about getting the same result just by writing “git lg”?

Add it as an alias

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”

Use it

Now just write “git lg” and enjoy the pretty git log!

Get Andreas Olsson’s stories in your inbox

Join Medium for free to get updates from this writer.

Credit to: https://coderwall.com/p/euwpig/a-better-git-log

--

--

Andreas Olsson
Andreas Olsson

Written by Andreas Olsson

Front-end guy who tries to learn more about back-end. React/React Native has my attention right now. I work with React and WordPress @http://cdab.eu