本文翻译自:Git conflict markers [duplicate]
This question already has an answer here: 这个问题在这里已有答案:
- Git merge left HEAD marks in my files 5 answers Git合并左侧HEAD标记在我的文件中 5个答案
After I pulled from remote branch, I got conflict, when I open the file it looks something like below: 从远程分支拉出后,我遇到了冲突,当我打开文件时,它看起来如下所示:
<<<<<<< HEAD:file.txt
Hello world
=======
Goodbye
>>>>>>> 77976da35a11db4580b80ae27e8d65caf5208086:file.txt
I need some explanations of the markers, which portion of code is pulled from remote and which is from local? 我需要对标记进行一些解释,哪部分代码是从远程拉出来的,哪些来自本地?
What does the code 77976da35a11db4580b80ae27e8d65caf5208086
stand for? 代码77976da35a11db4580b80ae27e8d65caf5208086
代表什么?
#1楼
参考:https://stackoom.com/question/X9dQ/Git冲突标记-重复
#2楼
The line (or lines) between the lines beginning <<<<<<<
and ======
here: 从<<<<<<<
和======
这里开始的行之间的一行(或多行):
<<<<<<< HEAD:file.txt
Hello world
=======
... is what you already had locally - you can tell because HEAD
points to your current branch or commit. ...就是你在本地已经拥有的东西 - 你可以说,因为HEAD
指向你当前的分支或提交。 The line (or lines) between the lines beginning =======
and >>>>>>>
: 行之间的行(或行) =======
和>>>>>>>
:
=======
Goodbye
>>>>>>> 77976da35a11db4580b80ae27e8d65caf5208086:file.txt
... is what was introduced by the other (pulled) commit, in this case 77976da35a11
. ...是另一个(拉)提交引入的内容,在本例中为77976da35a11
。 That is the object name (or "hash", "SHA1sum", etc.) of the commit that was merged into HEAD
. 这是合并到HEAD
中的提交的对象名称(或“hash”,“SHA1sum”等)。 All objects in git, whether they're commits (version), blobs (files), trees (directories) or tags have such an object name, which identifies them uniquely based on their content. git中的所有对象,无论它们是提交(版本),blob(文件),树(目录)还是标记都有这样的对象名称,它根据内容唯一地标识它们。