如何为子模块设置 git core.autocrlf

how to set git core.autocrlf for a submodule

是否可以为特定子模块配置 core.autocrlf=false? 我没有子模块的推送权限,所以我需要从外部设置它。

不要放 --global 应该就够了

git config core.autocrlf  false

但如果问题是如何做并在您的存储库中共享它以供 git 克隆,您不能。但是你可以使用一些技巧。关于如何做到这一点的答案 here for why you can't and there 关于如何更接近你想要的东西。 希望能有所帮助。