Rails使用<<<<<<<<< HEAD" [英] Rails messing up my code with "<<<<<<< HEAD"
问题描述
类ExampleController
def foo
bar = 1
<<<<<< HEAD
if bar == 1
putsbar is one
else
putsbar is not one
end
===== ==
if bar == 2
putsbar is two
else
putsbar is not two
end
>> >>>>> 17fb60436a4de2e0 ...
end
end
任何人都知道为什么它的行为如此
是的,你或其他人正在使用GIT来版本控制这些源代码,这很好。
现在您必须知道如何解决冲突!
如何解决Git中的合并冲突? 如果你是使用git的人,拉代码时请小心。如果在某处发生冲突,请停止!然后使用 git mergetool
或者浏览CONFLICT所涉及的每个文件的列表并手工编辑它们。
冲突的代码用<<<<<<< c $ c>来标记,< code> ========
和>>>>>>>
。你必须将它合并
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?
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
这篇关于Rails使用<<<<<<<<< HEAD"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!