forum/sync stages deletions on remotegit-annexhttp://git-annex.branchable.com/forum/sync_stages_deletions_on_remote/git-annexikiwiki2015-08-27T09:24:38Zcomment 1http://git-annex.branchable.com/forum/sync_stages_deletions_on_remote/comment_1_2b639066095e450c2d9be3b2775d24b3/Schnouki2014-04-17T12:16:41Z2014-04-17T12:16:41Z
Here's the output of <code>git annex sync --debug</code> (for a different commit): <a href="http://ix.io/bJZ">http://ix.io/bJZ</a>
comment 2http://git-annex.branchable.com/forum/sync_stages_deletions_on_remote/comment_2_da5775526a2a476b6ead1cd1a735b8bd/joeyh.name2014-04-17T19:28:59Z2014-04-17T19:28:59Z
<code>git annex sync</code> will push changes to your NAS, but this does not cause the work tree there to be updated. You must be running some command on the NAS that gets it work tree into the state you show. You need to tell us what that command is, since it seems to be where things are going wrong. Maybe you're running the git-annex assistant on the NAS, or maybe you run <code>git annex sync</code> on the NAS.
comment 3http://git-annex.branchable.com/forum/sync_stages_deletions_on_remote/comment_3_9e07593228915936fadcf90373be9f4e/Schnouki2014-04-22T14:59:47Z2014-04-22T14:59:47Z
<p>Not running the assistant (freshly rebooted NAS, checked with <code>ps ax | grep annex</code>), not running any other git command. Still happened, until a few minutes ago: I found the cause for this issue... and it's quite frustrating.</p>
<p>Every now and then, I interrupt a running <code>git annex sync</code> with Ctrl+C. And sometimes this causes my NAS repository to end up with <code>bare = true</code> in its <code>.git/config</code>. When this happens, I just remove the offending line and call it a day. Now I just added a <code>bare = false</code> line to that file, and that solved the problem. It seems that somehow, if you don't explicitely tell git that your repo is not bare, it considers it as a bare repository -- and the final push from <code>git annex sync</code> actually updates the <code>master</code> branch without updating the work tree.</p>
<p>This is probably not a bug in git-annex, but rather a weird behaviour in git -- and for sure something I didn't expect to happend. But anyway it works now <img src="http://git-annex.branchable.com/smileys/smile.png" alt=":)" /> Leaving this here in case it helps other people.</p>
<p>Joey, thanks again for your time and your help.</p>
comment 4http://git-annex.branchable.com/forum/sync_stages_deletions_on_remote/comment_4_e5a3dc34c6229ec40bc999c3cab28041/joeyh.name2014-04-24T18:22:16Z2014-04-24T18:22:16Z
git sets bare = false in newly created non-bare repositories. Perhaps this is why? It seems likely that git has an inconsistent default if there's no configuration. Sounds worth filing a bug on git for. OTOH, messing with .git/config in nonstandard ways seems like a good way to cause yourself random pain too.
Same problemhttp://git-annex.branchable.com/forum/sync_stages_deletions_on_remote/comment_5_f3350d336c6c66c3aacc7caade2ef12c/edward2015-08-27T09:24:38Z2015-08-27T09:24:38Z
<p>I think I'm having the same problem. See my comments on <span class="createlink"><a href="http://git-annex.branchable.com/ikiwiki.cgi?do=create&from=forum%2Fsync_stages_deletions_on_remote%2Fcomment_5_f3350d336c6c66c3aacc7caade2ef12c&page=bugs%2Fgit_annex_sync_deleted_a_bunch_of_files___40__not_expected__41__" rel="nofollow">?</a>git annex sync deleted a bunch of files (not expected)</span></p>
<p>I've run <code>git annex sync</code> or <code>git annex webapp</code> on the laptop annex, then <code>git annex sync</code> on the external drive. I'm pretty sure some of the syncs have been interrupted. Does it help to see the .git/config from the external drive?</p>
<pre><code>[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = /home/edward/annex
fetch = +refs/heads/*:refs/remotes/origin/*
annex-uuid = 38d109c9-7f5f-47cd-b15a-7b2beac22c64
[branch "master"]
remote = origin
merge = refs/heads/master
[annex]
uuid = 822dec0f-a0d3-42f6-b0dc-a47b6bf91944
version = 5
[remote "x230"]
url = /home/edward/annex
fetch = +refs/heads/*:refs/remotes/x230/*
annex-uuid = 38d109c9-7f5f-47cd-b15a-7b2beac22c64
</code></pre>
<p>Observations about my config, I have <code>bare = false</code>, which is correct. Do you think it is a problem that I have two remotes, <code>"origin"</code> and <code>"x230"</code> pointing at the same location?</p>