我怎样才能重新规范我的git repo

时间:2014-03-01 03:32:19

标签: git line-endings core.autocrlf

我已将core.autocrlf选项更新为true(在Windows下);现在我想重新规范我的git存储库。我怎么能这样做?

1 个答案:

答案 0 :(得分:2)

git rm --cached -r .
# Remove everything from the index.

git reset --hard
# Write both the index and working directory from git's database.

git add .
# Prepare to make a commit by staging all the files that will get normalized.
# This is your chance to inspect which files were never normalized. You should
# get lots of messages like: "warning: CRLF will be replaced by LF in file."

git commit -m "Normalize line endings"
# Commit

参考:https://help.github.com/articles/dealing-with-line-endings