首页 > 解决方案 > Git 是否对 core.autocrlf 和 .gitattributes text=auto 使用相同的启发式?

问题描述

通过添加* text=auto到 .gitattributes 文件,Git 使用自己的启发式方法来确定文件是否为文本,而不是二进制文件,以实现换行规范化。(资源)

据推测,Git 还需要一个启发式方法来确定它是否会在core.autocrlf = true.

两种情况是否使用相同的启发式?

或者换句话说,在core.autocrlf=true功能上等同于Windows 机器上* text=auto的 .gitattributes 文件?core.eol=native(除了 .gitattributes 是每个 repo 并且core.autocrlf是每个用户/系统)

标签: gitcore.autocrlf

解决方案


推荐阅读