Hacker News new | ask | show | jobs
by CodeIsTheEnd 850 days ago
My favorite line in my .gitconfig is an alias that prints out the commit history as a tidy graph. (The default `git log --graph` uses 6 whole lines per commit!)

    [alias]
        lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all -n 15
Which I took from this Stack Overflow post: https://stackoverflow.com/questions/1057564/pretty-git-branc...
3 comments

Simplified version I can type from memory (I.e. on a system where I don’t have my gitconfig aliases):

  -—graph -—oneline -—color
You just gave me a lesson "why one should not just paste things he found online into his terminal". Your parameters have Em dash instead of a hyphen... I reinstalled git from dedicated official repositories before I realized my git is not old... the param is indeed incorrect.
I'm sorry. I should have had a copy-paste warning -- typing from a phone... I knew it was coming.
In case you didn't know about it, `tig` does just that by default (and a whole lot more).
I like how --all reveals forgotten refs.