So, I have this new repo where I'm trying to start a collaborative project. I have already pushed .gitignore
and .gitattributes
(handling auto-crlf) files to it.
My .gitattributes
file is:
# 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
I created a repository on GitHub and cloned it to my PC via SourceTree. Now, I'm trying to create a new CLion project inside it, but when I try to add CMake
and main.c
files to be committed, I get an LF to CRLF error:
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
The thing is, these files are created in Windows by me (CLion, actually), so I can't see why this error is coming up.