The log shows the history of the commit snapshots.
There are several log options. The default one isn’t such useful actually.
I usually view my log with the following options.
$ git log --oneline --graph --decorate --color --all
It’s a very long command, right? So I usually set it as an alias command. This can be done by setting the alias in the
[alias] lg = log --all --oneline --graph --decorate --color
.gitconfig file is usually in the home directory.
So what does those options mean?
--onelineshows the simplified version.
--graphshows the commit relationship path on the left. So that the sequence of log becomes a commit path.
--allshows all branches, including the remote branch. Otherwise,
git logonly shows the current branch.
--decorateshows the branch pointers to the commits.
--color, as the name suggests, makes the log output colorful and easier to read.