0

Here is the session log of my 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. 

It looks like I can't commit because I didn't merge, but merge also failed.

So how do I resolve it?

2
  • The message says very clearly: Fix them up in the work tree, and then use git add/rm. Not git merge, git add or git rm. Each file that has a U next to it needs to be edited to resolve the conflicts and then git add it. Commented May 23, 2016 at 2:46
  • @meagar, there are 2 files in the dbinterface/Debug directory. Can I exclude them? Because they will be overwritten with every build during development. Or I will have to fix them and then add them to .gitignore? Thank you. Commented May 23, 2016 at 3:08

1 Answer 1

1

A merge is just a commit with multiple parents. A merge conflict works like any other unfinished work-in-progress. Any files which were successfully merged will already be staged (added). Any files where the merge failed will not be staged; they will be partially merged with markers (<<<<<) showing the conflicting lines. A git status will show you this and give you instructions.

Do what you'd normally do to finish a commit: edit the files which are unstaged to fix the conflicts and add them. When you've added everything and your tests pass, commit.

More information can be found in the Basic Branching and Merging section of Pro Git.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.