Viewing the history

We already covered the basic use of the git log command and of the --oneline option. We can use other options with this command. For example, the --stat will produce stats about the files that were changed in each commit.

git log --oneline --stat

Take a look at the last commit. Here Git is telling us that on this commit, 5 files were changed. There were a total of 7 insertions and 4 deletions. Of those, 3 insertions and 1 deletion were made to audience.txt, 1 insertion was done to the file objectives.txt, and one deletion and one insertion were done to each of the other files.

Viewing the history 1
Viewing the history 2

To see the actual changes in each commit we use

git log --online --patch

Here we can see that, for example, in the audience.txt file, four lines were inserted: 1) a line at the top with the AUDIENCE title, followed by 2) a blank line, and finally 3) a line with the text No prior experience is required..


If you find this view confusing, you can always open the file with VS Code. Just open VS Code by running

code .

Now navigate to the file and click on the TIMELINE tab at the bottom of the navigation panel.

Viewing the history 3