如何用 .gitattributes 表达 core.autocrlf = false?

How to express core.autocrlf = false with .gitattributes?

这太棒了。在互联网上关于 core.autocrlf.gitattributes 的无数帖子我仍然无法弄清楚在 .gitattributes 中写什么来表达 core.autocrlf = false

谁能拨开周围的雾气?我不需要所有花哨的案例,只需在 .gitattributes 中给我 core.autocrlf = false。仅此而已。

如果您不想对文件进行行结束转换,请设置 -text 属性。要关闭 所有 个文件的转换,请设置:

* -text

请注意,这并不意味着 "this file isn't text" - 那将是 binary 属性 - 它意味着 "don't do text manipulations (line ending changes) on it".