forum/How do I sync files from mobile to a repo?git-annexhttp://git-annex.branchable.com/forum/How_do_I_sync_files_from_mobile_to_a_repo__63__/git-annexikiwiki2014-09-18T18:05:33Zadditionhttp://git-annex.branchable.com/forum/How_do_I_sync_files_from_mobile_to_a_repo__63__/comment_1_fc914b5998a09943fc8c1917a0e36096/Petter_petterson2014-09-13T07:54:58Z2014-09-13T07:54:58Z
I understand that the copy of the cellphones' photos are stored on the server too, when typing git annex whereis I see that it exists on the server, but I need to be able to, at will copy out the jpg files for editing and using in other places.
comment 2http://git-annex.branchable.com/forum/How_do_I_sync_files_from_mobile_to_a_repo__63__/comment_2_fd5257eff7f94971557c031a94ac2766/Justin2014-09-14T18:57:12Z2014-09-14T18:57:12Z
If <code>/computer1/annex/</code> was already an annex repository you should have synced the phone to that, not to a new bare repository at <code>/computer1/annex/mobile/</code>
comment 3http://git-annex.branchable.com/forum/How_do_I_sync_files_from_mobile_to_a_repo__63__/comment_3_5a11c45f92bae1328a5120945bee1fa0/Petter_petterson2014-09-16T08:13:59Z2014-09-16T08:13:59Z
<p>Thanks Justin, but that wont work. Even pointing out a normal, non-bare repo and then adding it as a ssh remote will convert it into a bare repo. I confirmed that, and then I read this post:</p>
<pre><code>http://git-annex.branchable.com/forum/Local_and_remote_in_direct_mode/
</code></pre>
<p>that states that</p>
<blockquote><p>The "Remote server using ssh" option in the webapp is intended to set up a bare git repository on a server, not a non-bare git repository on a client."</p></blockquote>
<p>I even tried to do
git remote add B ssh://machineB:/~/annex
but to no avail, the created annex on machine B becomes a bare repo.</p>
<p>The only way to do it for me was to do the following,
Assume my cellphone is device A, and my desktop is device B:</p>
<p>On machine B:</p>
<pre><code>cd ~/DCIM
git init
git annex init "B"
git annex direct
echo '*/5 * * * * * cd ~/DCIM; git annex sync' > crontab
</code></pre>
<p>On machine A:</p>
<pre><code>git clone ssh://user@machineB:/home/user/DCIM
git annex sync
git annex webapp
</code></pre>
<p>now pictures are synced to the computer in direct, non-bare format every 5 minutes. I have spent literally days on this and now I finally nailed it in a crude but working fashion.</p>
comment 4http://git-annex.branchable.com/forum/How_do_I_sync_files_from_mobile_to_a_repo__63__/comment_4_404a8f9daa86c20a046b4c9f9051dfc0/joeyh.name2014-09-18T18:00:42Z2014-09-18T18:00:42Z
<p>I have double-checked, and when I already have an existing, non-bare repository, pointing the webapp at it over ssh keeps it as a non-bare repository. As I would expect.</p>
<blockquote><p>I even tried to do git remote add B ssh://machineB:/~/annex but to no avail, the created annex on machine B becomes a bare repo.</p></blockquote>
<p>I didn't try this because it's such a violation of the way git actually works that I just can't believe it could happen. If it does, you've found the git bug of the year.</p>
<p>But, I think you just got confused about whether the repository existed before, or gave the wrong path to the existing repository which would result in a new, bare repository being created in the location you told it.</p>
<p>If you really think this happens, show a transcript with enough details for me, or the git developers, to reproduce the problem.</p>
comment 5http://git-annex.branchable.com/forum/How_do_I_sync_files_from_mobile_to_a_repo__63__/comment_5_3dcdaef370d0df38e7285f1fa11c6bb3/joeyh.name2014-09-18T18:05:33Z2014-09-18T18:05:33Z
It occurs to me that another way you could have gotten confused is, if ssh://machineB:/~/annex was eg, created in the first place by running the git-annex webapp on machineB, then it would be a direct mode repo. In this case, yes core.bare=true, but so does annex.direct=true. And that repository will not be a bare repo really; it will contain the same file tree as you have on your mobile.