Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当您使用Linux和Windows时,最好的git配置设置是什么?_Linux_Git_Windows 7 - Fatal编程技术网

当您使用Linux和Windows时,最好的git配置设置是什么?

当您使用Linux和Windows时,最好的git配置设置是什么?,linux,git,windows-7,Linux,Git,Windows 7,我对git配置的core.eol、core.autocrlf、core.safecrlf有点困惑 我正在使用Ubuntu和Widows 我以前有^M和其他问题 有人能为这个问题推荐最好的git配置吗 提前感谢。如中所述,我将使用: git config --system core.autocrlf false 这将避免任何自动eol转换(有关此选项值的确切含义,请参阅“” 您可以将其保留为true,如中所述,但我更喜欢设置core.eol+一些gittattribute文件,以便微调我希望启

我对git配置的core.eol、core.autocrlf、core.safecrlf有点困惑

我正在使用Ubuntu和Widows

我以前有^M和其他问题

有人能为这个问题推荐最好的git配置吗

提前感谢。

如中所述,我将使用:

git config --system core.autocrlf false
这将避免任何自动eol转换(有关此选项值的确切含义,请参阅“”

您可以将其保留为true,如中所述,但我更喜欢设置
core.eol
+一些
gittattribute
文件,以便微调我希望启用eol更改的一些文件。

有关更多详细信息,请参阅。

+1-我知道有很多建议,但我也会始终选择
core.autocrlf
设置为
false
,并确保您只使用足够好的工具来处理不同的行尾(VonC在第一个链接答案中给出一个点),但当您遇到差异时,此设置会给出一个^M,是吗?@shin:对于在Windows上编写的文件和在Windows上完成的差异,我在差异期间从未见过
^M