我已经设置了 .gitattributes
的内容文件在我的 项目的根对此:
members/2/dist/** text eol=LF
members/2/contacts/details/view/health/build/** text eol=LF
members/2/framework/cr.compressed-paths.js text eol=LF
members/2/framework/cr.loaderConfig.js text eol=LF
嵌套在 dist/和 health/build 路径下的文件应该以 LF 结尾存储。这些文件都是从各种 Windows 进程自动生成的,这就是(似乎)要使用的。当然,我的项目根目录下有一个成员文件。
运行上述过程后,我看到这两个目录下的待处理更改,但 SourceTree 中没有显示任何可见更改。尝试提交会产生此错误:
warning: LF will be replaced by CRLF in members/2/contacts/details/view/health/build/allergy-component-bundle.js.
The file will have its original line endings in your working directory.
我的 .gitattributes 文件是否设置错误?当 .gitattributes 说使用 LF 时,为什么 SourceTree 试图转换回 CRLF?
我还会注意到,切换到 tortoiseGit 会显示这些相同的文件已更改,因此问题似乎出在我的 git 配置上,而不是 SourceTree。
最佳答案
似乎解决这个问题的最好方法就是像这样关闭规范化
members/2/dist/** -text
members/2/contacts/details/view/health/build/** -text
members/2/framework/cr.compressed-paths.js -text
members/2/framework/cr.loaderConfig.js -text
关于git - SourceTree 不尊重 .gitattributes 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32383554/