我有两个分支 Z 有一些变化,而 M 有一些相互冲突的变化。我想将 Z 上的第一个更改合并到 M 中。当我尝试查看哪些更改仍然存在时。(实际上还有一些变化,但这已经表明了问题)
$ git checkout M
$ git cherry M Z
+ 153c2f840f2192382be1fc435ceb069f0814d7ff
+ 4a7979d5dd526245b51769db21acf4c286825036
$ git cherry-pick 153c2f840f2192382be1fc435ceb069f0814d7ff
error: could not apply 153c2f8... add Z
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'
• (M|CHERRY-PICKING) $ git st
# On branch M
# Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# both modified: README.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
• (M|CHERRY-PICKING) $ vim README.txt
我在这里解决了冲突
• (M|CHERRY-PICKING) $ git add README.txt
• (M|CHERRY-PICKING) $ git ci -m'cherry picked'
[M dc5de35] cherry picked
1 file changed, 1 insertion(+), 1 deletion(-)
• (M) $ git cherry M Z
+ 153c2f840f2192382be1fc435ceb069f0814d7ff
+ 4a7979d5dd526245b51769db21acf4c286825036
因此,在我提交更改后,它仍然认为这两个更改都不是我所期待的精心挑选的:
- 153c2f840f2192382be1fc435ceb069f0814d7ff
+ 4a7979d5dd526245b51769db21acf4c286825036
一周后我怎么知道我已经合并了 153c2f ?我怎样才能以它会知道该合并的方式进行挑选?