2015-02-05 94 views
0

我正在使用Git for Windows 1.9.5;我的遠程倉庫混合行結束(一些CRLF一些LF)。我想將遠程存儲庫標準化爲完全LF。如何在Windows Git中將行尾標準化爲LF

我的設置:

git config core.eol lf 
git config core.autocrlf false 
.gitattributes * text=auto 

我曾嘗試:

Refreshing a respoitory after changing line endings

git rm --cached -r . 
git reset --hard 
git status 

gitattributes documentation

rm .git/index  # Remove the index to force git to 
git reset   # re-scan the working directory 
git status  # Show files that will be normalized 

This SO answer

git rm --cached -rf . 
git diff --cached --name-only -z | xargs -n 50 -0 git add -f 
git ls-files -z | xargs -0 rm 
git checkout . 
git status 

git status後,我打開的文件在文本編輯器的採樣,並期望他們從CRLF改爲LF行結束符,但都沒有。

我需要做什麼才能將本地和遠程存儲庫中的所有行結束符更改爲LF?

回答

-1

您想在遠程存儲庫上設置CRLF。你確定?其他人會反對嗎?

提交更改後,是否將它們推送到遠程?

.gitattributes你需要設置

eol=crlf 
text=auto 

當你做你的git status你應該注意到你有很多的「改變」的文件。如果你犯這些,那應該是鰻魚的改變。

+0

這是一條評論,而不是答案。 – Makoto 2015-02-05 20:14:07

+0

是的,我確定。不,我還沒有提交或推動任何更改,因爲我還沒有做出令人滿意的更改。這就是這個問題的目的 - 確定如何使變更提交。 – PaulH 2015-02-05 20:14:33

+0

@Makato呃這是一個答案。他需要推動這些變化。 – robert 2015-02-05 20:16:09

相關問題