(no commit message)
authorpaperbenni <paperbenni@web>
Tue, 19 Oct 2021 16:45:12 +0000 (16:45 +0000)
committeradmin <admin@branchable.com>
Tue, 19 Oct 2021 16:45:12 +0000 (16:45 +0000)
doc/forum/git_annex_sync_destroys_data_on_shallow_clones.mdwn [new file with mode: 0644]

diff --git a/doc/forum/git_annex_sync_destroys_data_on_shallow_clones.mdwn b/doc/forum/git_annex_sync_destroys_data_on_shallow_clones.mdwn
new file mode 100644 (file)
index 0000000..1b88cd0
--- /dev/null
@@ -0,0 +1,2 @@
+I just migrated binaries from native git file tracking to git annex. Then I went on to clone the repo on a different device. Because older commits still contain the binaries I did a shallow clone. After that I wanted to fetch a few binaries from annex and ran ```git annex init; git annex sync```. 
+To my surprise instead of somehow working out the annex metadata with the remote it just force pushed an empty git-annex branch to the remote. Luckily I was just testing things out and had a backup available but for people who rely on a service like gitlab to access their annex repository when traveling this can end up being a very nasty surprise. I don't exactly know how this could best be fixed but force pushing without asking isn't a good solution in my opinion. Maybe git-annex-init could check if a remote already has annex metadata and pull that. git-annex-sync could fail and give you the option to add a force flag or work out how to merge things (which shouldn't be too hard when the local metadata is completely empty)