2014-12-08 173 views
0

在我编写代码之后,我提交了更改,然后输入git pull origin master以获取其他人的更改。之后,git说:修复合并冲突后,git return每次都无法合并错误

CONFLICT (content): Merge conflict in file.c 
Automatic merge failed; fix conflicts and then commit the result. 

我输入git mergetool并修复冲突。

在那之后,我再次键入git pull origin master,每次git的说:

error: Entry file.c' would be overwritten by merge. Cannot merge. 

当我输入git status我看其他人的变化。

我清洁指数,并承诺所有其他人的变化来摆脱这个问题

这是为什么发生的?修复合并冲突后应该怎么做?

我使用Git版本1.5.3.3

回答

1

您需要git commit冲突解决第一。

+0

你能更具体吗? – Jubobs 2014-12-08 09:20:35

+0

@Jubobs更详细的我猜,但我不知道如何回答这个更具体的比解决合并冲突包括提交说修复 – 2014-12-08 09:24:57

+0

如果我在合并修复后提交,其他人的变化出现在提交。这个是正常的?为什么我看到其他人变化? – user4757345 2014-12-08 10:59:51

1

此命令的顺序是:git的拉原点主 这说明冲突:

  1. 使用命令从回购拉最新代码。

  2. 使用您选择的IDE解决冲突。

  3. 在您的本地提交更改。

事情应该没问题,下一次你拉最新的主人。