git-annex-resolvemerge(1)

πŸ“¦
version 10.20261026 Β· 2 versions
  • 10.20261026 Β· alpine 3.24, arch rolling, debian bookworm, debian trixie, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 8.20210223 Β· ubuntu jammy
, in alpine 3.24, arch rolling, debian bookworm, debian trixie, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… git-annex-resolvemerge β€” from the git-annex manual, bestie

okay so this page lives in the git-annex manual (General Commands Manual, if you're fancy) and it's literally just about fixing merge conflicts. no cap.


✨ NAME ✨

git-annex-resolvemerge β€” resolve merge conflicts 🫢


🌸 SYNOPSIS 🌸

git annex resolvemerge

that's it. that's the whole command. iconic.


πŸ¦‹ DESCRIPTION πŸ¦‹

so this bad boy automatically resolves a conflicted merge. and like, plot twist, it's already happening behind your back β€” git annex sync and git annex merge do this automatically. you're just here for the solo version.

here's the tea, case by case:

  • when two trees being merged contain conflicting versions of an annexed file, the merge conflict gets resolved by adding both versions to the tree, using variants of the filename. both girls get to stay. πŸ’–
  • when one tree modified the file and the other tree deleted it, the conflict gets resolved by adding the modified file using a variant of the filename, and the original filename stays deleted. no resurrection, sorry.
  • when the merge conflict involves a file that's annexed in one tree but not annexed in the other tree, it gets resolved by keeping the non-annexed file as-is, and adding the annexed version using a variant of the filename.
⚠️ ok important caveat, don't skip this: only merge conflicts that involve one or more annexed files get resolved. merge conflicts between two files that are not annexed will not be automatically resolved. those are your problem, bestie. 😭

πŸŽ€ EXAMPLES πŸŽ€

let's set the scene. ✨

scenario one: the classic

suppose Alice commits a change to annexed file foo, and Bob commits a different change to the same file foo.

merging between them will then fail, and git will present the merge conflict as a file foo pointing to one version of the git-annex symlink, with git status indicating that foo has an unresolved conflict. 🫠

running git annex resolvemerge in this situation will resolve the merge conflict, by replacing the file foo with files named like foo.variant-c696 and foo.variant-f16a. one of the files has the content that Alice committed, and the other has the content that Bob committed.

then you, the main character, can examine the two variants of the file, and either merge the two changes into a single file, or rename one of them back to foo and delete the other. your call, queen. πŸ‘‘


scenario two: the delete situation

now suppose Alice commits a change to annexed file bar, while Bob commits a deletion of the same file bar. merging will fail. running git annex resolvemerge in this situation will resolve the merge conflict by making a file with a name like bar.variant-421f containing Alice's version. the bar file remains deleted. the user can later examine the variant of the file and either rename it back to bar, or decide to delete it too.

rip to Bob's deletion but Alice is different. πŸ’€


πŸ’… OPTIONS πŸ’…


🌈 SEE ALSO 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Joey Hess <id@joeyh.name> β€” we stan. 🫢


and that's the whole page, bestie!! this was git-annex-resolvemerge(1) from the git-annex manual β€” no version or date info was on the page, so consider this your cute sign-off instead. go resolve those merges, you've got this. πŸ’–βœ¨πŸŽ€