I'm having some problems with a direct mode Git Annex repository, created through the Assistant.
I've got two diverged copies of the repository, and I want to reconcile the differences. I ran git annex sync, and it generated a load of files describing the conflicts. I don't want this as I just want to merge preferring the state from one particular repository.
I know this is possible to do in Git, and while having a direct mode repository makes this trickier, this is what I've attempted. I ran:
git annex proxy -- git merge remotes/remote1/master -X ours
This worked for some files, automatically resolving the merge conflict. However, some files were modified in one repository, and deleted in the other.
Unfortunately, git annex proxy
now refuses to work due to this:
git-annex: Failed to set up proxy work tree.
CallStack (from HasCallStack):
error, called at ./Command/Proxy.hs:60:33 in main:Command.Proxy
So, I can't run the git commands I need to.
Reading the direct mode page, it does state that any git command will work if you pass -c core.bare=false
. I've tried this with the status, merge and add commands, but all of them refuse to work (saying: `fatal: this operation must be run in a work tree).
My immediate problem is trying to recover the repository I've seemingly broken. I can't work out how to either abort the merge, or resolve the conflicts. Any ideas?
More generally, it would be interesting to know what I did wrong to get in to this mess. All I wanted to do was a merge without having to go round and sort all the variant files that would have been generated by a simple sync.
I'd encourage you to stop using direct mode, which is well on its way to being deprecated and has never been flexible enough to do this kind of thing easily.
If you
git annex upgrade
that repository, you will get a v7 repository with an adjusted unlocked branch checked out, which is equivilant to a direct mode repository, but lets you use arbitrary git commands for merging etc.