最终将使用哪个版本的git文件:LOCAL,BASE还是REMOTE? [英] Which version of the git file will be finally used: LOCAL, BASE or REMOTE?

查看:2191
本文介绍了最终将使用哪个版本的git文件:LOCAL,BASE还是REMOTE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

git merge 期间发生碰撞时,我打开一个名为 Melt的mergetool 。它打开三个文件LOCAL,BASE和REMOTE。正如我读过的LOCAL是我的本地分支,BASE是共同的祖先,REMOTE是要合并的分支。



现在我的问题是:哪个版本的文件将终于用了?它是远程的吗?如果是这样,我可以根据需要编辑它,无论BASE分支是什么样的?例如

解决方案

中间: BASE



实际上, BASE 是不是共同的祖先,而是以>>>>< / code>和<<< <



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



在此处查看屏幕截图





您可以编辑您可以使用或不使用meld命令来使用 BASE 文件。

您也可以使用您最喜爱的文本编辑器。



  • <<<<< HEAD ===== 标记是合并之前的本地文件之一。
  • ==== >>>>> <分行名称> 是远程档案中的一个。


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?

解决方案

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

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.

这篇关于最终将使用哪个版本的git文件:LOCAL,BASE还是REMOTE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆