I saw Scott Chacon use
git lol on an introduction to git video, and thought it looked like a neat alias idea. I did some searching and came across this blog post by Franz Bettag, in which he creates an alias for
git log called
git lol. I’m not sure if he came up with it, but it looks like Scott Chacon is the person from whom people seem to learn about it. Unfortunately the gist links on Franz’s blog post don’t work for me, so to help me find them again in the future, I thought I would re-post his post here:
He starts with:
So i got tired of the git log default output, since it was simply too bloated for my Macbook Pro Terminal. It’s ok my 30" Apple Cinema Display (or one of the other 22" surrounding it), but even there it doesn’t show me enough for my taste.
The default output looks something like this:
The missing gist code for this was:
$ git log commit 9f0349d992f1c3e7f278096d27cd13d8d990c2df Author: Franz Bettag <email@example.com> Date: Fri Nov 12 20:46:19 2010 +0100 Now finally does frickin pull first. commit 1cc98b07391383addc5b998b4fcf1e5a4233faad Author: Franz Bettag <firstname.lastname@example.org> Date: Wed Nov 10 10:37:22 2010 +0100 Added auto-update. commit 405970a3947a8fa9f2b462df78a8dcd359051c52 Author: Franz Bettag <email@example.com> Date: Wed Nov 10 10:24:27 2010 +0100 Initial import.
He then went on to say:
Imagine this for 300+ commits, you literally will never see the end of it.
He then gave a gist for his combination of parameters for the
git log command:
$ git log --graph --decorate --pretty=oneline --abbrev-commit --all * 9f0349d (HEAD, origin/master, origin/HEAD, master) Now finally does frickin pull first. * 1cc98b0 Added auto-update. * 405970a Initial import.
And lastly, the aliasing (with gist):
After diddling around with git log parameters, i’ve come up with this neat constellation.
$ git config --global --add alias.lol "log --graph --decorate --pretty=oneline --abbrev-commit --all" $ git lol * 9f0349d (HEAD, origin/master, origin/HEAD, master) Now finally does frickin pull first. * 1cc98b0 Added auto-update. * 405970a Initial import.
So now I have another tool for my tool-belt (or alias of my git config) in adding
git lol to my repertoire of git commands.
For those of you new to git log,
page up and
page down move you up and down the buffer, and don’t forget to press
q when your done to close it out.