I have problems with a merge, but git doesn't mark the file as conflicted.
When I try to open the file with git mergetool
, git just says: No files need merging
.
How can I open a file without merge conflict in a three way compare?
I have problems with a merge, but git doesn't mark the file as conflicted.
When I try to open the file with git mergetool
, git just says: No files need merging
.
How can I open a file without merge conflict in a three way compare?
You can do the following:
git merge --no-commit topic
git checkout --merge that_file
git mergetool that_file
git commit
That is, you avoid that the successful merge creates a commit, then you pretend that there was a conflict in that_file
, then you can treat the file with git mergetool
. Finally, you commit the result.
sadly I coudln't reproduce @Filp Stefanov's success, so I did it the hard way by hand
(from the repository root)
git merge --no-ff --no-commit <topic>
git show HEAD:<file> > <file>.ours
git show MERGE_HEAD:<file> > <file>.theirs
$(git config merge.tool) <file>.ours <file> <file>.theirs
rm <file>.ours <file>.theirs
git add <file>
git commit
said outloud thats,
I wouldn't be surprised if that's basically what git does natively
git mergetool uses tool specified in .gitconfig [merge] section
git mergetool --tool-help
Checkout this topic
Configure one of those as git diff tool
For example:
git config --global diff.tool kdiff3
But as i know git diff can do only 2-way diff.
Solution is to checkout 3 different directories and run kdiff3