Leap

git log

· Sai Kiran

git log’s output that looks beautiful and makes lot of sense.

If you are using any GUI clients for git you might already have a one nice looking commit log. But if you are still using console or want to know how to customize git log’s output then visit git-log doc. There you can learn to customize git log the way you like it.

If you are using any shell configurations like oh my zsh, you will get some pre-configured aliases like glo,glol,glola,glog and gloga. They are just few variations of git log.

Any variation with --graph flag will make lot of sense — especially when you have a big merge commit.

Suppose you have diverged from master — to work on a interesting feature. Your colleagues continued on master with their work. After merging you will expect commits from the branch will be on top of all commits on master. But if you check via git log you can only see the merge commit on top but not the commits that are part of merge. Commits that are part of merge commits may be shown in the middle of master commits. Because all the commits are sorted based on timestamp. It confused me for sometime when I thought of checking out to a particular commit way before the merge commit and observed some commits that are part of merge commit shown below the commit I wanted to checkout to.

With --graph flag we will get nice and expected output.