forum/export single filegit-annexhttp://git-annex.branchable.com/forum/export_single_file/git-annexikiwiki2019-01-21T15:42:51Zcomment 1http://git-annex.branchable.com/forum/export_single_file/comment_1_36d97e3c3f07411f3d367da546759ea5/andrew2019-01-21T15:42:51Z2018-11-17T18:17:27Z
And some more detail… I am implementing a feature in <a href="https://github.com/andrewringler/git-annex-turtle">git-annex-turtle</a> where you can right-click on a file, select Share and have that file uploaded to some public place, then i'll let the user know the public URL so they can share it (perhaps by placing it in their copy-paste buffer). I thought at first I could use <a href="http://git-annex.branchable.com/git-annex-export/">git-annex export</a> but I don't think it is really designed for this use case. I think export is meant to export a tree to a non-git-ish place and then merge changes into that remote tree as you make changes locally.
comment 2http://git-annex.branchable.com/forum/export_single_file/comment_2_ec3d3fb7beb3312571ffa471c39aaf95/andrew2019-01-21T15:42:51Z2018-11-17T19:13:24Z
<p>OK. It looks like one way I could achieve this is by following these instructions <a href="https://git-annex.branchable.com/tips/publishing_your_files_to_the_public/old_method/">old method</a>. Basically just <code>git annex copy --to</code> the file to a public s3 repo without encryption and without chunking and with <code>public=yes</code> then grab the URL.</p>
<p>It seems this should also work for any remote that supports <code>WHEREIS Key</code> for getting a URL from any key.</p>
comment 3http://git-annex.branchable.com/forum/export_single_file/comment_3_0761201bf68e1086d263776eb953c1e1/joey2019-01-21T15:42:51Z2018-12-09T15:22:09Z
<p><code>git annex export</code> only exports trees, but you can easily make a tree
containing only a single file, and then export that.</p>
<p>For example:</p>
<pre><code>mkdir exporttree
cp tests/tests1.mov exporttree
git annex add exporttree
git commit -m 'created export tree'
git annex export master:exporttree --to public
</code></pre>
<p>If you don't want to commit that you can switch to a temporary branch
and build the tree there. Or there are plenty of lower-level git commands
to build trees.</p>