File: Handling_merge_conflicts_in_direct_mode.mdwn

package info (click to toggle)
git-annex 10.20250416-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 73,572 kB
  • sloc: haskell: 90,656; javascript: 9,103; sh: 1,469; makefile: 211; perl: 137; ansic: 44
file content (27 lines) | stat: -rw-r--r-- 1,638 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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.