在git合并冲突中,生成的BACKUP,BASE,LOCAL和REMOTE文件是什么? [英] In a git merge conflict, what are the BACKUP, BASE, LOCAL, and REMOTE files that are generated?
本文介绍了在git合并冲突中,生成的BACKUP,BASE,LOCAL和REMOTE文件是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我假设LOCAL和REMOTE文件正是它们的名字所暗示的,但BASE和BACKUP是什么?
Git执行三向合并,找到您正在合并的两个分支的共同祖先(又名合并基础)。当您在冲突时调用 git mergetool
时,它会生成适合输入到典型3路合并工具的这些文件。因此: -
foo.LOCAL
:冲突的我们即包含合并结果的分支(HEAD
) -
foo.REMOTE
code>:冲突的他们一方 - 您正在合并的分支 -
foo.BASE
:共同的祖先。用于提供三路合并工具 -
foo.BACKUP
:调用合并工具之前的文件内容将是保存在文件系统中,如果mergetool.keepBackup = true
。
HEAD
I assume the LOCAL and REMOTE files are just what their name suggests, but what are BASE and BACKUP for?
解决方案
Git performs a three-way merge, finding the common ancestor (aka "merge base") of the two branches you are merging. When you invoke git mergetool
on a conflict, it will produce these files suitable for feeding into a typical 3-way merge tool. Thus:
foo.LOCAL
: the "ours" side of the conflict - ie, your branch (HEAD
) that will contain the results of the mergefoo.REMOTE
: the "theirs" side of the conflict - the branch you are merging intoHEAD
foo.BASE
: the common ancestor. useful for feeding into a three-way merge toolfoo.BACKUP
: the contents of file before invoking the merge tool, will be kept on the filesystem ifmergetool.keepBackup = true
.
这篇关于在git合并冲突中,生成的BACKUP,BASE,LOCAL和REMOTE文件是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文