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- .gitdirectory)
- Make a new file .gitignorein the repository
- Make a new file .gitattributesin 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.txtin the repository containing CRLF
- Commit: git add -A, thengit commit -m "<something>"
- Note that A's document.txtstill contains CRLF (and deleting it and resetting with--hardreturns the version still with CRLF)
- SCP the whole directory to computer B
- Add a new file new filecontaining CRLF
- Commit: git add -A, thengit commit -m "<something>"
- Note that B's document.txtand B'snew fileboth still contain CRLF
- Pull B's master to A: git pull <remote> master:master_recv
- A's document.txthas changed to LF. The added filenew filealso contains LF.
The problem does not occur if B is a Windows machine.
 
     
     
     
    

 
     
     
     
    