首页 > 解决方案 > How can I see what "previous resolution" git applied?

问题描述

When cherry-picking a commit with similar resolutions to a previously resolved patch I sometime see git saying it tried to re-apply what I'd done earlier. I believe this is the rerere component of git.

$ git cherry-pick ...
error: could not apply a123f6c424... [commit message]
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Resolved 'path/to/file.c' using previous resolution.

The problem is I don't trust my previous resolution. How can I see what the "previous resolution" did? I.e. the diff of just the conflicting areas.

I know I can re-do the merge completely with the following commands. However, I don't want to completely throw away the previous work, just review and validate it.

git rerere forget path/to/file.c
git checkout -m path/to/file.c
# Resolve. e.g., git mergetool

The following questions are similar but are for merge commits, not conflicts in general or uncommitted changes.

标签: gitmerge-conflict-resolutiongit-merge-conflictgit-rerere

解决方案


推荐阅读