How to view the latest commit made within a particular folder on GitHub – 030

Something I had a hard time grasping early on using GitHub was why the latest commit would keep change. Obviously, at the root level (homepage level), the Latest commit is showing the latest commit for the entire repo, but why does it keep changing after that?

The latest commit is showing you the commit for the last time any files at this folder level were modified. Let’s look at my simple random-example.

When you go to the main repo page, you’ll see the Latest commit c8cac61 3 days ago (at the time of this writing) is the last commit to the repo.

main repo page - Latest commit c8cac61 3 days ago

But then if you click inside the Randomness folder, you’ll see the latest commit changes to Latest commit 567c29d 6 days ago.

Randomness folder showing commit 567c29d 6 days ago

And if you continue to drill down into these folders, you’ll see that the latest commit continues to change to c59c490 6 days ago.

Latest commit c59c490 6 days ago

What is with all these changes?

The latest commit is showing you the commit for the last time any files at this folder level were modified.

Again, I’m a visual learner (as you’ve noticed by now), so here’s an example. In the image below, you are looking at the C# Project folder called Randomness with Latest commit 567c29d 6 days ago. Notice how there are multiple files.

Randomness folder showing Latest commit 567c29d 6 days ago

Clicking the Latest commit 567c29d 6 days ago shows the actual file(s) that were modified as part of that commit, which in this case was just one file.

commit 567c29d showing only 1 file Class1.cs modified

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s