For some reason lately, every time I pull and get a merge conflict, running git mergetool
reports \"No files need merging\":
$ git pull
First, r
Merge tools are better at resolving conflicts than stock git. It can't be too opinionated. For example Beyond Compare is syntax aware and will do a lot for you. If you have it configured right, you can just compile and run your solution to test. If it's all good, then just git add -A
and git rebase --continue
. What you are experiencing is normal. Double check your "trust mergetool exit code" setting:
git config --global mergetool.trustExitCode true
Note: the -A option in git add
will stage all changes including deletions and new, untracked files.
It looks like my problem had to do with file timestamps. Thanks to this SO answer suggested by Mark Longair, the following setting fixed it for me:
git config --global core.trustctime false
This fixed it for me:
git mergetool .
I found this fix here
Solution 1:
$git config --global core.trustctime false
If false, the ctime differences between the index and the working copy are ignored; useful when the inode change time is regularly modified by something outside Git (file system crawlers and some backup systems). and core.trustctime is true by default.
Solution 2: just:
$git rebase --skip
It's OK for you to skip it
Could it be that you must first run merge? Then if there are merge conflicts to resolve, you can run mergetool. But until there are created as the results of an incomplete merge, I think mergetool will simply report there is nothing to merge.
Trivial solution
which worked for me:
Git creates some merge related files in the very same directory where the conflicted file is, so remember to run git mergetool
in correct path.