将存储库克隆到 Windows 时,如何阻止 git 添加回车符?
我的笔记本电脑上仍然有 XP,并安装了 Git,以便我可以对其进行一些工作。 当我从我的服务器(Linux)克隆存储库时,它会自动在每一行添加回车符。 所以现在 Git 认为每个文件都已被修改,而事实上,它们没有。
我尝试将以下行添加到我的 .gitconfig 文件中但无济于事
[core]
autocrlf = true
,或者
[core]
autocrlf = input
我也尝试
git config core.autocrlf <value>
在有问题的存储库中运行,然后重置硬头。 这似乎也不起作用。 任何帮助,将不胜感激。
I still have XP on my laptop and have installed Git so that I can do some work on it. When I clone a repository from my server (which is linux) it automatically adds carriage returns onto each line. So now Git thinks that every file has been modified when, in fact, they haven't.
I've tried adding the following lines to my .gitconfig file to no avail
[core]
autocrlf = true
or
[core]
autocrlf = input
I have also tried running
git config core.autocrlf <value>
within the repository in question, and then reset hard to head. This also didn't seem to work.
Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不“autocrlf = false?”。
Why not "autocrlf = false?".