git - 如何更改Gitlab中 merge 操作中使用的core.autocrlf?

标签 git gitlab gitlab-ce

当我们在本地 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/

相关文章:

git - 如何在 gitlab 中更改现有 merge 请求的源分支?

ruby-on-rails - 如何使用 bundler 强制更新 gem?

git - 暂时禁用 github Webhook

linux - 有没有办法仍然为.gitignore 使用符号链接(symbolic link)?为什么不再支持它作为符号链接(symbolic link)?

gitlab - 如何从 GitLab 13 ci 构建过程中排除 master 分支?

gitlab - 访问 $GITLAB/admin/runners 时出现内部服务器错误 500

git - 如何使用 reposurgeon 将 svn 存储库转换为 git?

node.js - npm:找不到命令 - Gitlab CI 特定运行程序

gitlab - 有没有办法在 CSV 文件中导出 GitLab 合并请求 + 评论

linux - 为 gitlab docker 镜像备份代码存储库的适当策略是什么?