Viewing history

We can browse the history of our repository by running

git log

This will print the last commits done on our repository starting from the newest one. The first line is the commit ID, then it shows us the author of that commit, the date and time at which the commit was done, and the one-line description for the commit.


To see more commits press the space bar. This will print the next page in the commit log. To quit, press q.

Viewing history 1
Viewing history 2

We can add the --oneline option to tell Git to print a summary of the history. Git will show the last 7 characters of the commit ID, followed by the commit message.


If we want the commit history to be printed in reverse order (oldest first), we just need to add the --reverse option to our command.