According to the documentation on core-eol
Sets the line ending type to use in the working directory for files that are marked as text (either by having the text attribute set, or by having text=auto and Git auto-detecting the contents as text).
So question #1 is: Does core-eol work at all without having a .gitattributes file?
Question #2 is is this for checkout to the working directory or check-in from the working directory to index? Or both?
With git for windows 2.33.1 and global settings (no local) for core.autocrlf = false
(so it does not override core.eol) and core.eol = crlf
and running Git Bash (echo command > results in eol=LF)
1. git config --global core.autocrlf false
2. git config --global core.eol crlf
3. mkdir testEOL
4. cd testEOL
5. echo Hello > hello.txt // file has LF eol
6. git init
7. git add . // file still has LF eol in working directory
8. git commit -m "Initial commit"
9. echo "* text" > .gitattributes
10. git add . // file has LF eol, however -> warning: LF will be replaced by CRLF in .gitattributes.
11. git commit -m "Git attributes"
12. echo New Line >> hello.txt
13. git add . // warning: LF will be replaced by CRLF in hello.txt.
14. git commit -m "Change to hello"
14a. git rm hello.txt
15. git reset --hard HEAD // EDIT: hello.txt has CRLF
The answers to the questions seem:
- No (line 7)
- Check-in and check-out (lines 10,13 and 15) - after removal of files fist (see updated 14a)
Is it just my experiment or is this true?