如何通过父项目中的.gitattributes将子行结尾强制转换为子模块中的LF?

问题描述 投票:7回答:1

我有一个存储库来存储我的所有Vim设置。它使用子模块来插入Pathogen的插件(我看过其他插件管理器,到目前为止没有兴趣)。由于MSYSGit在为提交消息打开Vim时处理行结尾的方式,我需要将存储库与Unix行结尾一起存储(eol = lf)。

我尝试在主仓库中添加一个带有内容的.gitattributes文件:

* eol=lf
* text=auto

在使用git rm --cached -r .git reset --hard刷新主存储库之后,主回购中的行结尾现在是LF。但是,在子模块中运行相同的命令不起作用。

tl; dr:如何配置我的git repo以便用LF行结尾检出子模块?

git git-submodules line-endings gitattributes
1个回答
0
投票

git config --global core.autocrlf true

© www.soinside.com 2019 - 2024. All rights reserved.