How do I get git to stop changing newlines in my files?
Leaving aside the mystery of what a version control is doing modifying files by itself, how do I configure this software so it never, ever, changes my files?
- How to enable command line for Git
- Git mergetool with Perforce
- Problem connecting to GitHub on Windows, even via PuTTY
- Is there a setting with git to allow a clone to use http on one OS and ssh on another?
- programmatically delete .git .idx .pack files
- Ignoring directories in Git repos on Windows
2 Solutions collect form web for “How do I get git to stop changing newlines in my files?”
You have many options depending on your OS:
The reason for the seemingly bizarre behavior is explained there. Basically the code is being shared (git and github) but the OS may be different. As different OS’s treat linefeeds differently, something has to change…
git config --system core.autocrlf false git config --system core.whitespace cr-at-eol
Don’t allow it to change anything or report problematic CR bytes at the end.