Skip to main content

GitKit: Learn git and GitHub in Context

Section 3.1 Exploring Your Local Repository

Watermark text: DRAFT

Like in the previous chapter, you will be working within the KitClient for this exercise.
Current State:
Figure 3.1.1 shows where you should be based upon the exercises in the previous chapter. You will have forked the upstream FarmData2 repository into your own GitHub account. You will then have cloned your fork into a local repository on your computer. Your local files at this point are a copy that reflects the current state of the upstream main branch.
Let’s explore this state just a little before making the changes that address the issue that you have claimed.
Cloud image of fork, clone, and local files.
Figure 3.1.1. Fork, Clone and Local Files.

Exercises

The git log command provides a way to see information about the history of the project. It will display information about the most recent commits that have been made to the repository. By default, git log displays information about the 10 most recent commits. You can append a -2 (or -5) to show only the most recent 2 (or 5) commits.

2.

Ensure that you are in your cloned repo (i.e. the GitKit-FarmData2 directory is your working directory). Then use the git log command to display the information about the 3 most recent commits. (If you don’t see more than two recent commits, press "return" or "spacebar" to see more; when you are done, press "q" to quit.)
A line that begins with "commit" appears at the start of the information about each commit. That line also contains a long string of numbers and letters. That string is called the SHA (secure hashing algorithm) hash. It is a string of digits (0-9) and letters (a-f) known as a hexadecimal number and it provides a unique identifier for the commit. Following the SHA hash is information about the author, the date the commit was made and the commit message that was used to describe the changes.
Use the output from the git log command to answer the following questions about the project history:
(a)
    What is the SHA of the most recent commit?
  • d622e8d6d71e27890c73e2428e6dcf9d44ca606e
  • That commit was made on Oct 11. There is a more recent commit.
  • 09ca29c9a4b5efa948c956c5af0896d773aa10d0
  • Correct! That commit was made most recently.
  • 80b4408aa0df6dadc4e5e2c310a5e5cbbc0b9d35
  • That commit was made on Oct 8. There are two more recent commits.
  • 1359864QU10776zp55552j8d868sn29q2w09877
  • This is not a valid SHA code as it contains capital letters and letters other than a-f.
Hint.
Look at the dates of each commit. The SHA code appears above the author of the commit and date the commit was made.
(b)
    What is the date of the most recent commit?
  • Oct 11 2021
  • There is a more recent commit.
  • Jul 23 2024
  • Correct! The most recent commit is shown first in the list.
  • Oct 8 2021
  • There is a more recent commit.
  • today
  • There shouldn’t be any commits today.
Hint.
To see the most recent commit you can scroll up in the terminal window or type the log command again.
(c)
    Who is the author of the third most recent commit?
  • Batese2001
  • This is not the author of the most recent commit.
  • kit
  • Correct! kit was the author of the most recent commit.
  • IrisSC
  • This is not the author of the most recent commit.
  • Grant Braught
  • This is not the author of the most recent commit.
Hint.
The author’s name will appear below the SHA and above the date of the commit.
(d)
    What is the purpose of the fourth most recent commit?
  • chore: install kit
  • This is the most recent commit. Look for the fourth most recent commit.
  • Reoder Seeding Input (#281)
  • Correct! The fourth commit reordered the seeding input.
  • Summary Table Timing and No Log Messages (#289)
  • This is the second most recent commit. Look for the fourth most recent commit.
  • No Default Label For Drop Down Component (#293)
  • This is the most third recent commit. Look for the fourth most recent commit.
Hint.
With your previous log command you only saw 3 commits. Try the command again so that it displays the 4 most recent commits.
You have attempted of activities on this page.