Disable git EOL Conversions
git
Solution
I figured it out. It seems that the SCP program was converting the line endings. I noticed this when I tried deliberately making a file with LF endings and then observing that it appeared as CRLF when downloaded.
Since this was the solution for me, I'm accepting this answer, but people of the future should also refer to the other answers for a more general solution.
Problem
I am trying to get git to not change any line endings whatsoever for any operation. Unfortunately, it seems to do so not matter what. I have reduced it down to the following test case, which has as many different mechanisms for disabling this behavior as I could find. - Begin with two machines (Windows computer = A, Linux computer = B) - On both machines: `git config --global core.autocrlf false` - On both machines: `git config --global core.eol crlf` (just in case) - Make new repository on A. From an empty folder: - `git init --shared` (then unhide the created `.git` directory) - Make a new file `.gitignore` in the repository - Make a new file `.gitattributes` in the repository with the single line: `* -text` - `git add .`, then `git commit -m "initial commit"` to work around, e.g. this. - `git branch master_recv` - Add remotes - Make a new file `document.txt` in the repository containing CRLF - Commit: `git add -A`, then `git commit -m "<something>"` - Note that A's `document.txt` still contains CRLF (and deleting it and resetting with `--hard` returns the version still with CRLF) - SCP the whole directory to computer B - Add a new file `new file` containing CRLF - Commit: `git add -A`, then `git commit -m "<something>"` - Note that B's `document.txt` and B's `new file` both still contain CRLF - Pull B's master to A: `git pull <remote> master:master_recv` - A's `document.txt` has changed to LF. The added file `new file` also contains LF. The problem does not occur if B is a Windows machine.