Search code examples
eclipsegitegit

GIT Pulling and merging generates Staged files and conflicts


We decided to go with the GITFlow Workflow and we use Eclipse (w/ EGit) to do the development of our software.

Whenever someone makes a commit and pushes it to the remote repository and I do a subsequent pull (or fetch and merge) I receive the changes and I have encountered 2 problems:

  • All the files the other developer changed appear to me as unstaged files. For me this doesn't make sense since as I haven't done anything with the files they should just update themselves.
  • Often we get merge conflict with files that when we look there isn't any conflict at all, i.e. they don't have any differences other than Git have copy and pasted the contents of the file again above the file.

Can someone please explain, point me to some information or something that would clarify me these points or how I should proceed with them?


Solution

  • The message of Aleksandr M clarify lots of thing : See stackoverflow.com/q/8227233/1700321 and stackoverflow.com/q/1510798/1700321. And use command line or SourceTree instead of egit. ;) – Aleksandr M 31 mins ago

    I also warn you to verify twice what you are pushing :

    Often we get merge conflict with files that when we look there isn't any conflict at all, i.e. they don't have any differences other than Git have copy and pasted the contents of the file again above the file.

    Even if a file is not modify, his binary associated can be, if you push the two, then there will be conflict because they don't have the same hash code SHA1.

    (Two object with the same SHA1 hash code are the same, it's use for identify the file, and two object with the same SHA1 hash code are never duplicated)