I have git on windows configured with git config --global core.autocrlf false
so that git does not auto convert files on checkout from LF line endings to CRLF.
When I create a new file on windows and add it I get the following output.
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.
So git is changing my line ending from windows to unix when the windows-file.txt is being added to the git index which is what I want.
The problem I have is that the working directory version is not changed, How can I configure git so that it changes the line endings of both the working directory and the git index?
UPDATE
After the add and the commit git status does not show any differences even though the local working directory version has windows line endings and the repo version has unix line endings.
UPDATE Contents of .gitattributes at the root of the repo
# 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