For example
> git cherry-pick <hash>
...
error: could not apply <hash>...
Resolved '<file>' using previous resolution.
> git mergetool
No files need merging
> git status
...
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: <file>
"both modified" and "No files need merging"? liar!
I'm guessing the problem is somehow git rerere got hold of a bad merge. I think this often happens when meld doesn't quite realise I've pressed Ctrl-S and it records conflict markers into the resolution. Why git still says "both modified" and doesn't allow mergetool to run I don't know. Anyway the fix is as follows:
git rerere forget <file>
git checkout -m <file>
git mergetool
I wish git checkout -m would imply git rerere forget or git status was more explicit. Would have saved a whole bunch of time.
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