git - How to verify the correct size of a cloned repo from GitHub? -


my question how verify actual size of cloned repository, comparing size on github, automatically check if repo has been downloaded correctly.

the problem size given github api not match size of cloned repo. here's do:

  1. i repository size using github api

    $ echo https://github.com/jemole/drscratch | perl -ne 'print $1 if m!([^/]+/[^/]+?)(?:.git)?$!' | xargs -i curl -s -k https://api.github.com/repos/'{}' | grep size

output: "size": 55617,

  1. i clone repository , calculate size of downloaded folder

    $ git clone https: //github.com/jemole/drscratch

    $ du -s drscratch

output: 69104 drscratch/

thanks!

the size of git repo vary, since there no canonical way git store data (at least there single objects vs. pack files, pack files might different between different repos -- size of local git repo before , after call git gc). can't use size measure correct download.

you can check local repo call git fsck, command walks through revisions , looks if each referenced object conforms hash.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -