Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git conflict - file deleted in HEAD and modified in revision

Tags:

git

Pretty new to git and have a bit of an issue i'm not sure how to fix. I mistakenly made a change to one file in a working copy and didn't commit the change. I then made changes to another copy and committed them - when I tried to pull the changes I unsurprisingly got an error saying my "local changes to the file would be overwritten by merge, aborting". So I removed the offending file using git rm, then used git add -u and committed the deletion. I then tried to pull in the latest copy and got the following. What's the best way to deal with this? grateful for any pointers

CONFLICT (delete/modify): wp-content/plugins/wp-flash-countdown/xml_option_.xml deleted in HEAD and modified in ba878ab1efe3a039961a446c490d5c93a2bc22e1. Version ba878ab1efe3a039961a446c490d5c93a2bc22e1 of wp-content/plugins/wp-flash-countdown/xml_option_.xml left in tree.
Automatic merge failed; fix conflicts and then commit the result.
like image 268
bsod99 Avatar asked Oct 09 '12 23:10

bsod99


1 Answers

Had a similar problem with a cheesy WordPress host. Try this..

git log --follow -- readme.html

Note the commit id of the last time that file existed (like before you deleted it.) Now you want to "checkout" that file from git.

git checkout (commit id) readme.html

Then add, commit, push, etc. Worked for me!

like image 65
PJ Brunet Avatar answered Sep 29 '22 03:09

PJ Brunet