Git hist sexiness
At work the other day I think Matt mentioned that he usually looks at his git log in color. This has been bothering me for a while now and I wondered why I didn’t have color on mine?
Up until now I’ve been using the git hist shortcut taught by Git Immersion (www.gitimmersion.com):
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
However, on macs there’s a trick: It turns out that you need to override default functionality by adding these lines:
[color]
ui = auto
[core]
pager = less -R
I also wanted to customize the color so I played around with it and here is my final:
hist = log --pretty=format:\"%C(yellow%h %ad%Creset | %s%C(bold red)%d%Creset [%C(bold blue)%an%Creset]\" --graph --date=short
And here’s my .gitconfig!
[color]
ui = auto
[core]
pager = less -R
[user]
name = Oliver Song
email = osong@mit.edu
[alias]
co = checkout
ci = commit
st = status
br = branch
hist = log --pretty=format:\"%C(yellow%h %ad%Creset | %s%C(bold red)%d%Creset [%C(bold blue)%an%Creset]\" --graph --date=short
rb = rebase
Check it:

*unf*