Git 冲突标记
从远程分支拉取后,出现冲突,当我打开文件时,它看起来如下所示:
<<<<<<< HEAD:file.txt
Hello world
=======
Goodbye
>>>>>>> 77976da35a11db4580b80ae27e8d65caf5208086:file.txt
我需要对标记进行一些解释,哪部分代码是从远程拉取的,哪部分是从本地拉取的?
代码 77976da35a11db4580b80ae27e8d65caf5208086
代表什么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此处以
<<<<<<<
和======
开头的行之间的一行(或多行):...是您本地已有的 - 您可以看出,因为
HEAD
指向您当前的分支或提交。以=======
和>>>>>>>
开头的行之间的一行(或多行):...是由其他(拉取的)提交引入的内容,在本例中是
77976da35a11
。这是合并到HEAD
的提交的对象名称(或“hash”、“SHA1sum”等)。 git 中的所有对象,无论是提交(版本)、blob(文件)、树(目录)还是标签,都具有这样的对象名称,该名称根据其内容唯一地标识它们。The line (or lines) between the lines beginning
<<<<<<<
and======
here:... is what you already had locally - you can tell because
HEAD
points to your current branch or commit. The line (or lines) between the lines beginning=======
and>>>>>>>
:... is what was introduced by the other (pulled) commit, in this case
77976da35a11
. That is the object name (or "hash", "SHA1sum", etc.) of the commit that was merged intoHEAD
. 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.