How do I get git to stop changing newlines in my files?

I’m using git/github with Eclipse/EGit on Windows. Something — not sure if it’s git or EGit — is modifying my files by playing games with newlines.

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 make git ignore changes in case?
  • Git doesn't connect from git bash but works in cmd.exe - 503 from proxy after CONNECT
  • Gitolite hook doesn't work
  • How can I import a directory structure into SVN, keeping the file and folder modifed dates the same?
  • Why does “Git help <command>” not launch html help in my browser, like it says it should?
  • Why doesn't .gitignore.txt file show it's name in windows10?
  • Is it possible to use winmerge to view git diffs from cygwin?
  • Windows + Cygwin + Single Line If Else + Puppet
  • 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:

    http://help.github.com/line-endings/

    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.

    Git Baby is a git and github fan, let's start git clone.