Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Github total clone statistics

Is there a way to get clone statistics of a github repository for any given month?

We have a Clones tab with stats for last 14 days https://help.github.com/articles/about-repository-graphs/#traffic but it would be interesting to look at the historical data.

like image 455
hellpanderr Avatar asked Sep 07 '25 03:09

hellpanderr


2 Answers

No. Neither the GitHub UI (https://github.com) nor the GitHub API (https://api.github.com) expose that data currently.

like image 82
jasonrudolph Avatar answered Sep 10 '25 06:09

jasonrudolph


Yes you can get your clone statistics about a GitHub repository for a given month, but you need to download the statistics before they are no longer available on GitHub.

I wrote a couple of scripts that you can find: https://github.com/BradleyA/Linux-admin/tree/master/github-repository-traffic#github-repository-traffic------------- It is a very simple shell script that uses crontab to schedule the download of GitHub traffic statistics in plain text from your GitHub repositories. Another script gives you the text lines to add to crontab and sets up the directories for GitHub traffic statistics. It takes minutes to setup but weeks to get enough data. At this point you can process the data with any tools you wish. I created a third script that parses the GitHub traffic and creates two markdown tables (clone, Views).

It solves my challenge. It may help you.

like image 31
Bradley Allen Avatar answered Sep 10 '25 06:09

Bradley Allen