Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merging Issues with Git

I am using git version 1.7.11.msysgit.0

I created a repository under GitHUB and added a file called as README.md with some text content .

Later on , I have installed GIT Client , did a clone to get the server contents on to my machine .

Then I deleted the file README.md on to my local machine .

Now when I do git commit , I get this error

praveenk@MSIN-BT-100 /d/workspace/MYTestRepo (master|MERGING) $ git commit ; U       README.md error: 'commit' is not possible because you have unmerged files. hint: Fix them up in the work tree, hint: and then use 'git add/rm <file>' as hint: appropriate to mark resolution and make a commit, hint: or use 'git commit -a'. fatal: Exiting because of an unresolved conflict. 

This is with git pull:

$ git pull; U       README.md A       One.txt Pull is not possible because you have unmerged files. Please, fix them up in the work tree, and then use 'git add/rm <file>' as appropriate to mark resolution, or use 'git commit -a'. 

How to resolve these errors ?

like image 277
Pawan Avatar asked Jul 17 '12 16:07

Pawan


2 Answers

Do this:

git merge --abort git pull (to be sure you're up-to-date) 

Now replace the contents of the README.md file with what you want it to say. If you don't want it at all, do git rm README.md

Then if you replaced the contents, commit and push those contents with:

git add README.md git commit -m "comment" git push 
like image 125
wadesworld Avatar answered Sep 22 '22 15:09

wadesworld


Try:

 git reset README.md 

I had a similar issue and this was the only thing that solved it.

like image 37
dorien Avatar answered Sep 18 '22 15:09

dorien