union和text和有什么不一样? [英] What is the difference between union and text?

查看:100
本文介绍了union和text和有什么不一样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在git repo的根目录下有一个.gitattributes文件.该文件包含以下值:

At the root of git repo a .gitattributes file. This file contains the following values:

*.txt     text merge=text
*.py      text merge=union

merge = text和merge = union有什么区别

what is the difference between merge=text and merge=union

推荐答案

内置合并驱动程序

Built-in merge drivers

定义了一些内置的低级合并驱动程序,它们可以是 通过merge属性询问.

There are a few built-in low-level merge drivers defined that can be asked for via the merge attribute.

文本:文本文件的常规三向文件级合并.冲突地区 用冲突标记<<<<<< ;、 ========和>>>>>>>标记.这 分支的版本显示在=======标记之前,并且 合并分支的版本显示在=======标记之后.

text: Usual 3-way file level merge for text files. Conflicted regions are marked with conflict markers <<<<<<<, ======= and >>>>>>>. The version from your branch appears before the ======= marker, and the version from the merged branch appears after the ======= marker.

二进制文件::将分支中的版本保留在工作树中,但保留 处于冲突状态的路径,供用户整理.

binary: Keep the version from your branch in the work tree, but leave the path in the conflicted state for the user to sort out.

联合:对文本文件运行三向文件级合并,但从 两种版本,而不是留下冲突标记.这倾向于 将添加的行按随机顺序保留在结果文件中,然后 用户应验证结果.如果您不这样做,请不要使用它 了解其中的含义.

union: Run 3-way file level merge for text files, but take lines from both versions, instead of leaving conflict markers. This tends to leave the added lines in the resulting file in random order and the user should verify the result. Do not use this if you do not understand the implications.

参考: http://schacon.github.io/git/gitattributes.html

这篇关于union和text和有什么不一样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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