6

I am using Github API to fetch the repo information. In that there is a parameter 'size', its not written in github api documentation what it exactly means. Is it the size of lines of code committed to the repository in bytes?

Here you can see the size parameter in the response returned http://developer.github.com/v3/repos/

Sachin
  • 3,672
  • 9
  • 55
  • 96

1 Answers1

8

Considering the commands are for a full repo (list, get, edit, ...), it should reference the full size of the elements in that repo, as mentioned in "See the size of a github repo before cloning it?".

It seems to be in Kb:

  • for small repos like the example repo "HelloWorld": "size": 140,: once I clone it, it register on my hard-drive slightly under 140 Kb,
  • and for larger repos (like the git repo itself, more than 40Mo: "size": 40844,).

Update (February 2013, from nulltoken's comment)

The answer "See the size of a github repo before cloning it?" confirms that the size is in Kb for git alternates objects.

The disk usage against the bare repository doesn't account for the shared object store and thus returns an "incomplete" value through the API call.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • That's what I thought bu that doesn't seem to be the case. I had cloned a repo django-allauth and the size it shows for it is only 140, whereas there is my own repo in which I have pushed C and C++ codes in that repo the size comes to around 4000 whereas the former should not be having such a small size – Sachin Jan 01 '13 at 07:24
  • It think your answer is right, I had mistaken in the size of the two repositories. Most probably the size is in kb – Sachin Jan 02 '13 at 07:48
  • @Sachin ok. Still a confirmation from GitHub support would be nice. – VonC Jan 02 '13 at 07:49
  • See update to this **[answer](http://stackoverflow.com/a/8679592/335418)** for more information about the way the size is calculated and some potential caveats. – nulltoken Feb 05 '13 at 14:55
  • @nulltoken thank you, and +1 to your answer ;) I have included your comment and referenced your answer in mine, for more visibility. – VonC Feb 05 '13 at 15:59
  • I can't believe they would just leave this unspecified. The docs only say "The size of the repository. Size is calculated hourly. When a repository is initially created, the size is 0." – Julius Naeumann Mar 09 '23 at 10:53
  • @JuliusNaeumann True, I only see that parameter explained more with [Repo content](https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#get-repository-content), but not for repo information. – VonC Mar 09 '23 at 12:06