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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With