我正在使用Ubuntu 14.04上的Git版本1.9.1。
我已经在一个新存储库中测试了
然而,在另一个存储库中,尽管有
我已经在一个新存储库中测试了
core.autocrlf
行为,并使用DOS格式和Unix格式文件进行了确认。当autocrlf=true
时,对于Unix格式文件,git add
会像预期的那样产生警告:LF will be replaced by CRLF in ...
消息,并且在autocrlf=false
时不会产生任何消息(在此情况下,我不清楚它为什么决定在存储库中使用DOS换行符而不是Unix换行符,但我不确定这在这里是否重要)。然而,在另一个存储库中,尽管有
autocrlf=true
,它仍然告诉我它将转换一些文件:$ git config core.autocrlf
false
$ git add lib/node_modules/pulp/node_modules/webpack/node_modules/webpack-core/node_modules/source-list-map/test/fixtures/from-to-tests/null-source.input.map
warning: CRLF will be replaced by LF in lib/node_modules/pulp/node_modules/webpack/node_modules/webpack-core/node_modules/source-list-map/test/fixtures/from-to-tests/null-source.input.map.
The file will have its original line endings in your working directory.
$
我弄不清楚为什么会这样。我在寻找问题的解释或调试的线索。
另外注意事项:
- 不,存储库中没有
.gitattributes
文件。但这提出了一个有趣的问题,如果autocrlf
设置为false,是否应该有所区别? - 而且,我刚刚仔细检查过,该文件在每个
0x0d
后面都有一个0x0a
,并且在每个0x0a
之前都有一个0x0d
。
.gitattributes
文件? - poke.gitattributes
文件?如果有,它们指定了哪些设置? - torekCRLF
和LF
? - Chananel Pfalse
。但在我的情况下,确实存在一个包含行* text=auto
的 ".gitattributes" 文件。一旦我将其删除,转换警告(以及希望的转换本身)就消失了。 - Jānis Elmeris