Huub Mons
Huub Mons

Reputation: 149

Rails messing up my code with "<<<<<<< HEAD"

I recently discovered that rails or some other entity is messing up my code by putting "<<<<<<< HEAD" all over the place. This is an example of what it looks like:

Class ExampleController
  def foo
    bar = 1
<<<<<<< HEAD
    if bar == 1
      puts "bar is one"   
    else
      puts "bar is not one"
    end
=======
  if bar == 2
    puts "bar is two"
  else
    puts "bar is not two"
  end
>>>>>>> 17fb60436a4de2e0...
  end
end

Anyone know why its behaving like this?

Upvotes: 2

Views: 1414

Answers (1)

Anthony Alberto
Anthony Alberto

Reputation: 10395

Yep, you or someone else is using GIT to version-control these sources, which is good.

Now you have to know how to resolve conflicts!

How to resolve merge conflicts in Git?

If you are the one using git, please be careful when pulling code. If there's CONFLICT written somewhere, STOP! Then use git mergetool or go through the list of each file concerned by a CONFLICT and edit them by hand.

Conflicting code is marked with <<<<<<, ======== and >>>>>>>. You have to merge it

Upvotes: 10

Related Questions