FORMAT="%C(auto)%h %C(magenta)%ad %C(cyan)%an%C(auto)%d %s"
PRETTY="--pretty=format:'$FORMAT' --date=short"
git config --global alias.lga "log --graph --all $PRETTY"
git config --global alias.lg "log --graph $PRETTY"
git config --global alias.la "log --all $PRETTY"
git config --global alias.ll "log $PRETTY"
git config --global alias.lf "log --pretty=fuller --stat"
There are two interesting things to note here:• Since the --decorate option is now enabled by default (at least since Git 2.13), I don't have the --decorate option in my aliases. You may have to add them if you are using an older version of Git.
• Often while looking at the commit log, I need to know the commit date and the committer name which --oneline option does not show by default, so instead of using the --oneline option, I am formatting the one-liner logs myself with the `--pretty=format:` option to see these details.
The --simplify-by-decoration option is a nice one, something I can add to my list of aliases.
I have these aliases and a few other useful aliases documented in a bonus section named "Nifty Commands" in a fork and pull request workflow document I shared on Hacker News about a month ago. Here is the URL: https://github.com/susam/gitpr.