最终会使用哪个版本的git文件:LOCAL,BASE或REMOTE?(Which version of the git file will be finally used: LOCAL, BASE o

编程入门 行业动态 更新时间:2024-10-20 11:41:59
最终会使用哪个版本的git文件:LOCAL,BASE或REMOTE?(Which version of the git file will be finally used: LOCAL, BASE or REMOTE?)

当git merge时有一个collison,我打开一个名为Meld的mergetool。 它打开三个文件LOCAL,BASE和REMOTE。 我读过LOCAL是我的本地分支,BASE是共同的祖先,REMOTE是要合并的分支。

现在我的问题:哪个版本的文件将被终止使用? 是否REMOTE? 如果是这样,我可以根据需要编辑它,不管BASE分支中有什么?

When there's a collison during git merge, I open a mergetool called Meld. It opens three files LOCAL, BASE and REMOTE. As I've read LOCAL is my local branch, BASE is common ancestor and REMOTE is the branch to be merged.

Now to my question: which version of the file will be finally used? Is it REMOTE? If so, can I edit it as I want, regardless what's in the BASE branch for example?

最满意答案

这是中间的一个: BASE 。

实际上, BASE并不是共同的祖先,而是在冲突被标记为>>>>和<<<<的半成品合并中。

您可以在meld编辑窗口顶部看到文件名。

看到这里的截图

融合基地

您可以使用或不使用meld命令来编辑BASE文件。 您也可以摆脱混合,只需使用自己喜欢的文本编辑器编辑文件。

<<<< HEAD和=====标记之间的代码是合并之前的本地文件之一。 ====和>>>> <branch name>之间的代码是远程文件之一。

It's the one in the middle : BASE.

In fact, BASE is not the common ancestor, but the half-finished merge where conflicts are marked with >>>> and <<<<.

You can see the file names on the top of meld editing window.

See the screenshot here

meld base

You can edit the BASE file as you want with or without using meld commands. You can also get rid of meld and just edit the file with your favorite text editor.

The code between <<<< HEAD and ===== markers is the one of your local file before the merge. The code between ==== and >>>> <branch name> is the one of the remote file.

更多推荐

本文发布于:2023-04-29 01:52:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1334531.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:版本   文件   LOCAL   BASE   git

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!