Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们正在 Windows、Linux 和 Mac 上跨平台工作,我们使用 GIT 进行协作。最近我们偶然发现了autocrlf避免Carriage Return和的设置Line Feed,并发现它们在不同的平台上表现出不同的行为。
autocrlf
Carriage Return
Line Feed
我们找到了一种解决方法来标记autocrlf = false. 但是每个队友都必须更改她在机器上的设置。
autocrlf = false
我的问题是,我们是否有一些解决方法可以签入 repo 中的 autocrlf 设置,这样用户就不必自己更改她的设置?并且设置会自动更新。
如果不强制每个用户更新其设置中的某些内容,就不可能做到这一点。
参见,例如,这里
您可以做的是创建服务器端钩子,拒绝更改行尾的提交,并告知开发人员如何正确设置他的 git 环境......