0

A merge from my master branch into my dev branch caused a conflict. When I attempt to resolve this conflict using Beyond Compare, I notice

"<<<<<<< HEAD", "=======", and ">>>>>>> (some branch in git)"

are showing in my code. I believe Beyond Compare and similar utilities should filter these strings out so we don't accidentally check them in.

Can someone confirm that this is a bug with Beyond Compare? Is there a workaround?

isherwood
  • 58,414
  • 16
  • 114
  • 157
burnt1ce
  • 14,387
  • 33
  • 102
  • 162
  • This isn't a bug with Beyond Compare, that is whatever you are using to do the merge (are you possibly using Source Tree?) pointing out that the code inside those points is something different. – Dave V Sep 01 '16 at 19:39
  • 1
    This is, in fact, expected behaviour. As @DaveV has pointed out, `git` uses these lines to mark where there are merge conflicts to be resolved. Just delete them before committing and you're good - a bit of discipline goes a long way. – Sebastian Lenartowicz Sep 01 '16 at 20:27
  • I'm actually using SmartGit as my git client and not Source Tree. – burnt1ce Sep 01 '16 at 20:51
  • I think I know what may have happened. In a prior merge conflict, I may have prematurely committed some conflicted files without properly resolving them. Fast foward a week or so, when I merged those two branches again, that's when I noticed those lines appearing in my dev branch. – burnt1ce Sep 01 '16 at 20:57

1 Answers1

1

This sounds like a side effect of an incorrectly configured merge tool in Git. Check out the documentation from Scooter Software for integrating:

Once configured, you can use the command git mergetool when you encounter a conflict. Git will walk through each conflicted file and prompt you to open the file in BC3/4. Using the tool this way will ensure that BC3/4 is called with the correct command line parameters to avoid the situation you are describing.

Additional note... Merging is only supported in the Professional (paid) version of Beyond Compare.

Kevin Burdett
  • 2,892
  • 1
  • 12
  • 19