2017-05-17 21 views
2

私は共同プロジェクトを開始しようとしています。私は既に.gitignore.gitattributes(auto-crlfを扱う)ファイルをそれにプッシュしました。Git:自作ファイルに行末の問題があります

.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プロジェクトを作成しようとしているが、私はコミットするCMakemain.cファイルを追加しようとすると、私はCRLFエラーにLFを得る:

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)で作成されているので、なぜこのエラーが出てくるのか分かりません。

+1

'.gitattributes'は実際にどのように見えますか?あなたは 'core.autocrlf'設定を持っていますか?あなたは 'core.safecrlf'設定を持っていますか? –

+0

デフォルトはGitのバージョン(およびビルド)によって異なりますのでご注意ください。 – Arafangion

+0

@EdwardThomson [ここ](http://imgur.com/a/lGfQR)は私の.gitattributesです –

答えて

関連する問題