当我们在本地 merge 时,我们使用 core.autocrlf=true
设置来正确处理行结尾差异。
从 Gitlab 的 Web 界面直接 merge 时如何控制 core.autocrlf
设置?
我们观察到,更改
选项卡中的某些文件似乎已完全更改,这可能与此设置有关。
附注所有开发人员都在本地拥有正确的 core.autocrlf
设置。
最佳答案
所有开发人员应该在本地拥有的唯一正确的 core.autocrlf
设置是:
git config --global core.autocrlf false
任何 eol 转换都应单独管理 through .gitattributes
,它是版本化的,是源的一部分,并且可以为特定的文件子集进行设置。
与 core.autocrlf
本地设置相反,后者由每个用户控制,并应用于每个文件(甚至是二进制文件)
这一原则反射(reflect)在 GitLab 问题中,例如 gitlab-org/gitlab
issue 21431
I think the proposed solution here is for both the Web IDE and the Single File Editor to properly support the use of a
.gitattributes
file when present.
但是,如gitlab-org/gitlab issue 14391所示,在执行 merge 请求时,WebEditor 仍然不支持此(.gitattributes
文件)。
因此,目前,当 MR 完全在 GitLab 端完成时,eol 无法得到妥善管理。
关于git - 如何更改Gitlab中 merge 操作中使用的core.autocrlf?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64549482/