Have you ever needed to quickly check the first commit date of a Git repository? There are at least three ways to do that: using the GitHub website, using the Git command-line interface and using the Git-First Chrome extension. In this post, we’ll briefly review these three methods and also find which is the most practical one to suit our needs.
#1. GitHub website
From the GitHub repository main page, click on the Insights tab of the repository, then navigate to the Network sub-tab on the left menu bar and wait for the “Loading graph data” message to disappear.
When the page is fully loaded, press Shift + Left Arrow to go all the way to the first commit, then click on the “dot” that represents the first commit to open it: the date you’re looking for will be clearly visible near the top-right part of the page.
This method is useful enough, yet it has two caveats:
- it might not work if the repository has too many forks because the Insights/Network tab currently supports up to 100 forks;
- it can be extremely slow if the repository features a lot of commits, branches, tags and/or forks: for example, the Network tab of the microsoft/vscode repository (Visual Studio Code), with hundreds of commits, branches, tags, and forks, takes more than 2 minutes to have its graph data loaded.
#2. GitHub CLI
Alternatively, you can clone the repository to your local machine and then run the following command from the console terminal prompt:
> git log --reverse
This Git CLI command will show all the repository’s commits in reverse order (oldest commit first).
This method can be great if you already have the updated repository cloned on your local disk, but it’s definitely unpractical otherwise.
#3. Git-First Chrome extension
The extension adds a context menu item called “Initial Commit”, which is only shown whenever you are on a repository page: by clicking this button, the extension will take you to the first commit page of the current repository.
Alternatively, the extension can be activated by clicking on the Git-First icon within the top-right part of the Google Chrome screen, together with the other extensions’ icons.
In our opinion, the Git-First Google Chrome extension is the fastest and therefore the most practical way to check for a GitHub’s repository first commit date, therefore we highly recommend it – especially if you need to check multiple repos and/or you frequently need to retrieve this kind of information.
That’s it for now: happy commit!