git config --global core.autocrlf false
で設定されたウィンドウでgitを実行しているので、チェックアウト時にgitがLF行末からCRLFにファイルを自動変換しません。gitで作業ディレクトリの行末を変更するには?
Windowsで新しいファイルを作成して追加すると、次の出力が表示されます。窓-file.txtとは、私が欲しいものであるGitのインデックスに追加されているとき
git add windows-file.txt
warning: CRLF will be replaced by LF in windows-file.txt.
The file will have its original line endings in your working directory.
ので、gitが窓からUNIXに終わる私のラインを変えています。
問題は、作業ディレクトリのバージョンが変更されていないことです。作業ディレクトリとgitインデックスの行末が変更されるようにgitを構成するにはどうすればよいですか?
UPDATE追加した後
とローカルの作業ディレクトリのバージョンは、Windowsの行末を持っており、レポバージョンはUnixの行末を持っているにもかかわらず、任意の違いを示していないgitの状態をコミットします。レポ
# Set default behaviour, in case users don't have core.autocrlf set.
text eol=lf
# These files are text and should be normalized (convert crlf => lf)
*.java text
*.xml text
*.cmd text
*.sh text
*.txt text
*.md text
*.js text
*.jsp text
*.html text
*.htm text
*.vm text
.project text
.classpath text
*.properties text
*.txt text
*.bat text
*.launch text
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.jar binary
*.class binary
*.gz binary
*.tar binary
*.dll binary
*.exe binary
*.zip binary
'git status'はファイルが異なっている(つまり汚れている)ことを示していますか? – asm
'git config --global'グローバル設定を変更します。リポジトリごとのローカル設定がまだ有効である可能性があります。 'git config core.autocrlf'は何を表示しますか? – mvp
@mvp私はローカルのgit per repo設定に精通していますが、globbalyを設定しています。私はまだ.gitattributesをサポートしているegitも使用していますので、 – ams