【发布时间】:2018-07-28 02:10:38
【问题描述】:
我有一个文件,一开始看起来像这样
asd
bnm
cvb
然后我添加了三个提交:
1.
asd feature1 c1
bnm
cvb
2.
asd feature1 c1
bnm feature1 c2
cvb
3.
asd feature1 c1
bnm feature1 c2
cvb feature1 c3
现在,当我想通过执行
来恢复第二次提交时git revert HEAD^
我收到这样的错误消息
error: could not revert 2222222... feature 1 commit 2
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'
我的文件看起来像这样
<<<<<<< HEAD
bnm feature1 c2
cvb feature1 c3
=======
bnm
cvb
\>>>>>>> parent of 2222222... feature 1 commit 2
我就是不明白为什么。我的假设是它会像 Edwar Thomson 在他对这个问题的回答中解释的那样工作: git revert: Why do I get conflicts? 我没有两次编辑第 2 行,不应该发生冲突。我错过了什么?
我希望结果是
asd feature1 c1
bnm
cvb feature1 c3
没有任何冲突。
【问题讨论】:
标签: git