dfens dfens - 1 month ago 9
Git Question

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

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

git count-objects

Is there a way to do it?


One little kludge you could use would be the following:

mkdir repo-name
cd repo-name
git init
git remote add origin <URL of remote>
git fetch origin

git fetch displays feedback along these lines:

remote: Counting objects: 95815, done.
remote: Compressing objects: 100% (25006/25006), done.
remote: Total 95815 (delta 69568), reused 95445 (delta 69317)
Receiving objects: 100% (95815/95815), 18.48 MiB | 16.84 MiB/s, done.

The steps on the remote end generally happen pretty fast; it's the receiving step that can be time-consuming. It doesn't actually show the total size, but you can certainly watch it for a second, and if you see "1% ... 23.75 GiB" you know you're in trouble, and you can cancel it.