我该如何解决这些错误

时间:2016-05-23 02:39:37

标签: git merge commit

这是我的github shell的会话日志:

C:\Users\Igor\OneDrive\Documents\dbhandler_app [master +258 ~0 -0 | +85 ~23 -269 !]> git commit
U       dbinterface/Debug/dbinterface.Build.CppClean.log
U       dbinterface/Debug/dbinterface.log
U       dbinterface/ReadMe.txt
U       dbinterface/database.h
U       dbinterface/dbinterface.sln
U       dbinterface/dbinterface.vcxproj
U       dbinterface/dbinterface.vcxproj.filters
U       dbinterface/dbinterface.vcxproj.user
U       dbinterface/stdafx.cpp
U       dbinterface/stdafx.h
U       dbinterface/targetver.h
error: commit is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
C:\Users\Igor\OneDrive\Documents\dbhandler_app [master +258 ~0 -0 | +85 ~23 -269 !]> git merge
error: merge is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
C:\Users\Igor\OneDrive\Documents\dbhandler_app [master +258 ~0 -0 | +85 ~23 -269 !]> git merge --no-commit
error: merge is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.

看起来我无法提交,因为我没有合并,但合并也失败了。

那我该如何解决呢?

1 个答案:

答案 0 :(得分:1)

合并只是一个包含多个父项的提交。合并冲突就像任何其他未完成的工作一样。任何成功合并的文件都已经上演(添加)。合并失败的任何文件都不会被暂存;它们将部分地与显示冲突线的标记(<<<<<)合并。 git status将向您显示此信息,并为您提供说明。

执行您通常要完成提交的操作:编辑未分阶段的文件以修复冲突并add。当你添加了所有内容并且你的测试通过后,提交。

可以在Basic Branching and MergingPro Git部分找到更多信息。