Why are there 3 commit SHAs when there are only 2 commits and commit messages

In this lesson, and in any other scenario, when you use the git log command to view your commit logs, you will see more SHAs that the number of commits and commit messages available.

An example log message is below. Here, there are 3 SHAs but there are only 2 commits/commit messages;

$ git log
commit 1f1e8a938be1733bac6caeb74cbd62117c6c3d87
Author: codecademy <ccuser@codecademy.com>
Date:   Fri Oct 9 01:30:54 2020 +0000

    first bio question

commit 3a294546f4a55f02bf37233ef8988d8b9dd7ce59
Author: danasselin <johndoe@example.com>
Date:   Tue Nov 3 12:33:23 2015 -0500

    Add heading and comment to biology quiz

commit 6aa7704a31d05541141fbb529abf946bd2fd41:
  1. Which SHA belong to which commit and commit message?
  2. Does a SHA come before its commit message or is it the other way around?
  3. Is the latest commit and its SHA stay at the top or at the bottom of the log messages?

Those SHA values aren’t for the author. Those are the SHA1s of the commits themselves (a commit hash).

Each one of those groups of text is a commit, so:

commit 1f1e8a938be1733bac6caeb74cbd62117c6c3d87
Author: codecademy <ccuser@codecademy.com>
Date:   Fri Oct 9 01:30:54 2020 +0000

    first bio question

That’s a commit. If you notice, each commit has a timestamp that will tell you how recent each commit is. git log without any additional flags will show you the commit history for the current branch.

This article might be helpful: Understanding Git Log - Mijingo