git config --global core.autocrlf input
git autocrlf輸入確實會轉換行尾,但是從LF到CRLF?
根據this github help page所以將所有行結束時提交到LF這應該配置的git。
然而,當提交到我的回購這是我得到的輸出。
> git commit -am "test commit"
warning: LF will be replaced by CRLF in .htaccess.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .htaccess.
The file will have its original line endings in your working directory.
[release/4.2 27bad5b] test commit
warning: LF will be replaced by CRLF in .htaccess.
The file will have its original line endings in your working directory.
1 files changed, 1 insertions(+), 1 deletions(-)
然後我檢查了我的配置,看看autocrlf選項是否正確設置,它是。
> git config -l | grep "crlf"
core.autocrlf=input
爲什麼git會說它將我的LF轉換爲CRLF,而不是我想要的其他方式?
爲什麼它會抱怨3次?是因爲它發現了3個將被替換的事件?爲什麼它會在輸出commithash之後警告我一次呢?
我很困惑(和MAC備案:)上)
(注意,github頁面僅在非windows標籤中提到了「autocrlf = input」...) – rogerdpack