2015-03-25 16:09:49 +00:00
|
|
|
# NAME
|
|
|
|
|
|
|
|
git-annex resolvemerge - resolve merge conflicts
|
|
|
|
|
|
|
|
# SYNOPSIS
|
|
|
|
|
|
|
|
git annex resolvemerge
|
|
|
|
|
|
|
|
# DESCRIPTION
|
|
|
|
|
2020-09-07 16:01:03 +00:00
|
|
|
Automatically resolves a conflicted merge. This is done
|
2015-03-25 16:09:49 +00:00
|
|
|
automatically when using `git annex sync` or `git annex merge`.
|
|
|
|
|
2020-09-07 16:01:03 +00:00
|
|
|
When two trees being merged contain conflicting versions of an annexed
|
|
|
|
file, the merge conflict will be resolved by adding both versions to the
|
|
|
|
tree, using variants of the filename.
|
|
|
|
|
|
|
|
When one tree modified the file, and the other tree deleted the file,
|
|
|
|
the merge conflict will be resolved by adding the modified file using a
|
|
|
|
variant of the filename, leaving the original filename deleted.
|
|
|
|
|
|
|
|
When the merge conflict involves a file that is annexed in one
|
|
|
|
tree, but is not annexed in the other tree, it is
|
|
|
|
resolved by keeping the non-annexed file as-is, and adding the annexed
|
|
|
|
version using a variant of the filename.
|
|
|
|
|
2017-06-01 15:56:56 +00:00
|
|
|
Note that only merge conflicts that involve one or more annexed files
|
|
|
|
are resolved. Merge conflicts between two files that are not annexed
|
|
|
|
will not be automatically resolved.
|
|
|
|
|
2020-09-07 16:01:03 +00:00
|
|
|
# EXAMPLES
|
2017-06-01 15:56:56 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
The user can then 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.
|
2015-03-25 16:09:49 +00:00
|
|
|
|
2020-09-07 16:01:03 +00:00
|
|
|
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.
|
|
|
|
|
2021-05-10 19:00:13 +00:00
|
|
|
# OPTIONS
|
|
|
|
|
|
|
|
* The [[git-annex-common-options]](1) can be used.
|
|
|
|
|
2015-03-25 16:09:49 +00:00
|
|
|
# SEE ALSO
|
|
|
|
|
|
|
|
[[git-annex]](1)
|
|
|
|
|
|
|
|
# AUTHOR
|
|
|
|
|
|
|
|
Joey Hess <id@joeyh.name>
|
|
|
|
|
|
|
|
Warning: Automatically converted into a man page by mdwn2man. Edit with care.
|