Is it possible to remote count object and size of git repository?

后端 未结 5 715

Assume that somewhere in the web exists public git repository. I want to clone it but firstly i need to be sure what is size of it (how much objects & kbytes like in

5条回答
  •  别那么骄傲
    2020-12-25 11:26

    For github repository, it now offer API to check file size. It works!

    This link: see-the-size-of-a-github-repo-before-cloning-it gave the answer

    Command: (answer from @VMTrooper)

    curl https://api.github.com/repos/$2/$3 | grep size
    

    Example:

    curl https://api.github.com/repos/Marijnh/CodeMirror | grep size
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
    100  5005  100  5005    0     0   2656      0  0:00:01  0:00:01 --:--:--  2779
    "size": 28589,
    

提交回复
热议问题