0

I am working in my own git-branch in a big project. Once I have a stable feature I send a pull request to get my updates into master.

Other colleagues however have their own branches and we have a blessed repo that we merge into our own branch to have the current newest stable global state.

Now here is the problem: When I fetch and then merge the blessed repo into my own branch, then I encounter a merge conflict (A prompt opens and just states -> conflicting)

Now the issue is that this happens for all the pom.xml (basically my whole project explorer is glowing red with merge conflicts in all the pom.xml, even on ones I never touched and are not relevant for my files)

If I open a pom.xml there are merge annotations like <----- HEAD and so on.

Now how do I resolve this? Do I really have to manually go into each and every file and edit this? Can't I just have the merge overwrite all my stuff ... except for the few classes I edited?

Vampire
  • 35,631
  • 4
  • 76
  • 102
aspirant
  • 1
  • 1
  • When was the last time you merged prior to this attempt? Do you have an editor that is formatting files (or otherwise making whitespace changes) without your knowledge? Can you show a diff for a file you never touched that is in conflict? – Brandon McKenzie May 19 '16 at 15:33
  • I have seen projects where after you release the code from Jenkins, a script goes and bumps the version #in pom file and auto commits it. May be it's the same case with your project in which case the pom versions in your branch can go out of sync with your colleagues branch which can cause merge conflicts. – Vishal May 20 '16 at 04:17
  • (Take a look particularly at the third answer: http://stackoverflow.com/a/7589612/2003763 ) – Thibault D. May 20 '16 at 06:20
  • @BrandonMcKenzie: Last time was 10 days ago. Also I can confirm that there has been no whitespace changes to my files and the pom.xml – aspirant May 20 '16 at 08:37
  • @VishalKamat Seems like this is indeed related to the pom.xml version, can this not be automated somehow? – aspirant May 20 '16 at 08:37
  • Not sure about automated process to avoid this situation but given this happened, you can do git checkout --ours '*/pom.xml' to choose your pom file to resolve the conflicts. If you want to use their version then instead of --ours use --theirs – Vishal May 20 '16 at 11:23
  • Thanks a lot for the help. In the end it was really the versioning that was *outdated* over multiple pom.xml ... this can be considered solved. – aspirant May 25 '16 at 15:08

0 Answers0