在将repo复制到windows上时,如何阻止git添加回车符?

时间:2023-02-05 15:16:48

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.

我的笔记本电脑上还有XP,并安装了Git,以便我可以做一些工作。当我从我的服务器(也就是linux)克隆存储库时,它会自动将回车添加到每一行。所以现在Git认为每个文件都被修改过,实际上他们没有。

I've tried adding the following lines to my .gitconfig file to no avail

我尝试将以下行添加到我的.gitconfig文件中无济于事

[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.

在有问题的存储库中,然后很难重置。这似乎也没有用。任何帮助,将不胜感激。

1 个解决方案

#1


Why not "autocrlf = false?".

为什么不“autocrlf = false?”。

#1


Why not "autocrlf = false?".

为什么不“autocrlf = false?”。