2016-05-23 75 views
0

は、ここに私のgithubのシェルのセッションログです:私は合併しなかったため、コミットするだけでなく、失敗したマージすることはできませんように私が解決するにはどうすればよいこれらのエラー

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. 

に見えます。

どうすれば解決できますか?

+0

メッセージは非常にはっきりと述べています:**作業ツリーでそれらを修正し、git add/rm **を使用してください。 'git merge'、' git add'、 'git rm'ではありません。その隣に 'U'がある各ファイルは、競合を解決するために編集し、' git add'する必要があります。 – meagar

+0

@ imagar、dbinterface/Debugディレクトリには2つのファイルがあります。除外することはできますか?開発中にすべてのビルドで上書きされるためです。または、私はそれらを修正してから.gitignoreに追加する必要がありますか?ありがとうございました。 – Igor

答えて

1

マージは複数の親を持つコミットに過ぎません。マージ競合は、他の未完成の作業進行中のように機能します。正常にマージされたファイルは、すでにステージング(追加)されています。マージが失敗したファイルはステージングされません。競合する線を示すマーカー(<<<<<)と部分的にマージされます。 git statusがこれを表示し、指示を与えます。

コミットを完了するために通常行っていること:競合を修正するためにステージングされていないファイルを編集し、addを編集します。すべてを追加してテストに合格すると、コミットします。

詳細は、Basic Branching and MergingセクションのPro Gitにあります。

関連する問題