Is there any way to see how big a git repo is on github before you decide to clone it? This seems like a really obvious/basic statistic but I can't find how to see it on github at all.
Join Stack Overflow to learn, share knowledge, and build your career.
|
|
There's a way to access this information through the GitHub API.
When retrieving information about a repository, a property named For instance, the Git repository weights around 40Mb. The Update:The size is indeed expressed in kilobytes based on the disk usage of the server -side bare repository. However, in order to avoid to waste too much space with repositories with a large network, GitHub relies on Git Alternates. In this configuration, calculating 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. This information has been given by the GitHub support. |
|||||||||||||||||||||
|
|
If you own the repo, you can find the exact size by opening your If you do not own the repository, you can fork it and then check the in the same place.
I do not remember if downloading as a zip ever worked, but in any case, doing so now only downloads the currently selected branch with no history. |
|||||||||||||||||||||
|
|
If you use Google Chrome browser you can install the GitHub Repository Size extension. Repo here: https://github.com/harshjv/github-repo-size |
|||||||||||||||||
|
|
@larowlan great sample code. With the new GitHub API V3, the curl statement needs to be updated. Also, the login is no longer required:
|
|||||
|
|
To do this with curl (sudo apt-get curl) and json pretty (sudo gem install jsonpretty json)
replace YOURGITHUBUSERNAME with your git hub username (go figure). replace OWNER with the repo owner's git username replace REPO with the repo name. Or as a nice bash script (paste this in a file named gitrepo-info)
use like so
This will give me info on the pisi/reel repo on github. |
||||
|
|
|
To summarize @larowlan, @VMTrooper, and @vahid chakoshy solutions:
|
|||
|
|
