Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You cannot get just an archive without precising the tree-is you want to get, when you are using <code>--remote</code></p> <pre><code>git archive --remote=ssh://git@bitbucket.org/username/reponame.git --format=tar --output="file.tar" master </code></pre> <p>Would work, mentioning a name of a branch.<br> That would work too with the name of a tag.</p> <p>However, according to <a href="http://git.661346.n2.nabble.com/Passing-commit-IDs-to-git-archive-td7359753.html" rel="noreferrer">this thread</a>, a commit ID would <em>not</em> work:</p> <blockquote> <p>Is there a reason <code>git-archive</code> requires a named ref rather than just a commit (or tree) ID?</p> <p>Yes; generally git repositories do not allow clients to access arbitrary sha1s. Instead, they require that the requested objects be accessible by a ref.</p> <p><code>git-archive</code> was not properly enforcing this, and was changed recently to allow only refs by name, as well as sub-trees of refs (e.g., <code>HEAD:subdir/</code>).<br> That means we do disallow an arbitrary commit or tree sha1, even if it is reachable from the advertised refs.</p> <blockquote> <p>would it be difficult to patch git-upload-archive to use the IDs?<br> I could use tags for the ref, but in my case would result in almost every commit being a tag which seems wasteful.</p> </blockquote> <p>Doing it right is a bit expensive, because in the general case (somebody requested a tree sha1), we would need to traverse every tree of every commit to see if it is reachable.</p> <p>We could potentially implement a more restricted set of rules, allowing "<code>&lt;commit&gt;:&lt;subdir&gt;</code>" and checking that <code>&lt;commit&gt;</code> is reachable.<br> That would disallow an arbitrary tree sha1, but I suspect it would cover the common use case (i.e., you want to get the tree, or even a subtree, of a particular revision). </p> </blockquote>
 

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