Git pull with conflict: change filename

A colleague of mine uses eclipse to rename many files for example: apple.java

beforeapple.java

so when i pull the code it has a conflict git prompt said i should delete this file before pushing but i dont want so how can i resolve this conflict?

+3


source to share


2 answers


When you changed the name of the eclipse git file, it was not reported. This means that it still expects "apple.java" to be on your hard drive, and it treats "Apple.java" as some kind of unloaded file (no one added).

What you have to do is move the files to your hard drive (in some way) and then "git mv" again.



Pull shouldn't be a problem once you've done this and make your changes.

+1


source


This is not the best way to rename the file like your colleague. Try git mv apple.java Apple.java

then git commit -m "Rename file"

, then: git pull

. This should fix your problem.



0


source







All Articles