thumb

Have you ever wondered when a GitHub repository was created? I was very surprised when I realized that GitHub does not display the repository creation date anywhere on the website. In this tutorial, you’ll learn how to know the creation date of any GitHub repository.

Preamble

Sometimes, for any reason, we need to know the creation date of a GitHub repository. In my case, I have many GitHub repositories (including private ones) and I don’t remember when I created some of them. Now some of these projects have grown and I decided to indicate in the “README” file how old a repository is :) I tried to find out the repository creation date, but I was very surprised when I realized that GitHub does not display the repository creation date anywhere on the GitHub website.

There are plenty of web browser extensions/plugins to the rescue. The disadvantage is that in order to use them we need to install them first :( I’m not a supporter of installing any application that will be used only once. Therefore, if you want to know the creation date of a GitHub repository, the only option is to find out when the first commit was made, right? Not exactly. Firstly, do note that the date on which a repository was created is not the same as the date on which the first commit was made. Creating a new project I first create a repository and start working with it locally on my laptop, and only after a while I make the first commit. Secondly, some projects have hundreds of commits, so finding the first commit on the GitHub website results in the waste a lot of time when trying to get to the first commit page.

Is there a quicker way to get the creation date of a GitHub repository? Fortunately there is a GitHub REST API. You may think that GitHub REST API is going to be complicated, but that’s not the case here. Unlike most of the other APIs, you don’t need to sign up to get access. GitHub provides free access to their REST API to get information of any GitHub repository, and this information includes the date of creation of the repository as well.

Further resources:

Let’s begin

Once we know about GitHub REST API, we can use it to find the creation date of a GitHub repository. It is a really easy process. We have two methods. The first method is using a web browser, and the second is using a terminal. Use the one that is convenient for you. Now, step by step guide.

Method №1

In this solution we will use a web browser. You do not need to download and install anything, because it is already built into every OS.


Launch your web browser. As a web browser, I use the Safari, but you can use any other web browser.


In the address bar of your web browser, type the following URL and press the Enter key to retrieve information of a GitHub repository.

https://api.github.com/repos/{:owner}/{:repository}

Note! In the URL above, replace the {:owner} and {:repository} parts with the values that can be found in the URL of the GitHub repository for which you want to know the creation date. For example, if the URL of the repository is https://github.com/ArthurGareginyan/batch-rename/, then the URL of it’s information will be https://api.github.com/repos/ArthurGareginyan/batch-rename.


When the data is received, you will see the GitHub repository information in JSON format. Next, look for created_at, this is the date that interests us. The date is in UTC format.

How to know the creation date of GitHub repository

Method №2

This is another method to do the same thing as in the previous solution (№1), but with use a terminal app. You do not need to download and install anything, because it is already built into every OS.


Launch your terminal app. As a terminal app, I use the Terminal, but you can use any other terminal app.

For macOS users: The Terminal app can be found in the Utilities folder of your Applications folder, or use Spotlight to find it.


In the terminal app, type the following command and press the Enter key to retrieve information of a GitHub repository.

curl https://api.github.com/repos/{:owner}/{:repository}

Note! In the command above, replace the {:owner} and {:repository} parts with the values that can be found in the URL of the GitHub repository for which you want to know the creation date. For example, if the URL of the repository is https://github.com/ArthurGareginyan/batch-rename/, then the URL of it’s information will be https://api.github.com/repos/ArthurGareginyan/batch-rename.


When the data is received, you will see the GitHub repository information in JSON format. Next, look for created_at, this is the date that interests us. The date is in UTC format.

How to know the creation date of GitHub repository

Conclusion

That’s it, you’re done. Now you know how to to find the creation date of a GitHub repository. So simple isn’t it?

Let me know in the comments section if you know another way to find the repository creation date.

I hope this article has helped you learn how to find the creation date of a GitHub repository. If this article has helped you then please leave a comment :smiley:

Thanks for reading!