每次我在分支之间切换时都会出错。
我已经这样做了几次:
https://help.github.com/articles/dealing-with-line-endings
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
并且问题仍然存在。
我的 .gitattribute 文件如下所示:
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto
# Explicitly declare text files we want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text
# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
我得到错误:
“错误:您对以下文件的本地更改将被结帐覆盖:”