Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think there are a couple problems with this question: <code>git count-objects</code> doesn't truly represent the size of a repository (even <code>git count-object -v</code> doesn't really); if you're using anything other than the dumb http transport, a new pack will be created for your clone when you make it; and (as VonC pointed out) anything you do to analyze a remote repo won't take into account the working copy size.</p> <p>That being said, if they are using the dumb http transport (github, for example, is not), you could write a shell script that used curl to query the sizes of all the objects and packs. That might get you closer, but it's making more http requests that you'll just have to make again to actually do the clone.</p> <p>It is possible to figure out what <code>git-fetch</code> would send across the wire (to a smart http transport) and send that to analyze the results, but it's not really a nice thing to do. Essentially you're asking the target server to pack up results that you're just going to download and throw away, so that you can download them again to save them.</p> <p>Something like these steps can be used to this effect:</p> <pre class="lang-sh prettyprint-override"><code>url=https://github.com/gitster/git.git git ls-remote $url | grep '[[:space:]]\(HEAD\|refs/heads/master\|refs/tags\)' | grep -v '\^{}$' | awk '{print "0032want " $1}' &gt; binarydata echo 00000009done &gt;&gt; binarydata curl -s -X POST --data-binary @binarydata \ -H "Content-Type: application/x-git-upload-pack-request" \ -H "Accept-Encoding: deflate, gzip" \ -H "Accept: application/x-git-upload-pack-result" \ -A "git/1.7.9" $url/git-upload-pack | wc -c </code></pre> <p>At the end of all of this, the remote server will have packed up master/HEAD and all the tags for you and you will have downloaded the entire pack file just to see how big it will be when you download it during your clone.</p> <p>When you finally do a clone, the working copy will be created as well, so the entire directory will be larger than these commands spit out, but the pack file generally is the largest part of a working copy with any significant history.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload