所以,我有这个新的仓库,我正在尝试开始一个协作项目。我已经向它推送.gitignore
和.gitattributes
(处理自动crlf)文件。
我的.gitattributes
文件是:
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Explicitly declare text files you 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
*.mdj binary
我在 GitHub 上创建了一个存储库,并通过 SourceTree 将其克隆到我的 PC 上。现在,我正在尝试在其中创建一个新的 CLion 项目,但是当我尝试 添加 CMake
和main.c
提交文件时,我收到 LF to CRLF 错误:
The following problems have occurred when adding the files:
fatal: LF would be replaced by CRLF in tpCuat/CMakeLists.txt
during executing git "C:\Program Files\Git\cmd\git.exe" -c core.quotedpath=false add --ignore-errors -- tpCuat/CMakeLists.txt
问题是,这些文件是我在 Windows 中创建的(实际上是 CLion),所以我不明白为什么会出现这个错误。