I have a directory called "test" in which I've placed some text files with various line endings. The trouble is Git for Windows insists on converting the file with LF line endings to CRLF because autocrlf is enabled.
To try and get around this I've placed a .gitattributes file in the root of the repository with:
test -text
The problem is it has no effect. I've tried deleting the file and doing git checkout
on it but it still has CRLF line endings even though the file in the remote repository has LF line endings.
What am I missing?
Using
test/**
instead oftest
as the pattern matcher in my .gitattributes fixed the issue. According to the documentation: