This happens because of how git deals with line endings differently on different operating systems. Because you're developing on a Windows system; the line endings are generally CRLF; but when the code is committed into the repository the line endings are changed to LF.
CRandLFare shorts for carriage return, and line feed respectively. They are used to represent end-of-line markers (bytecode). Windows systems generally roll along theCRLFway; and the Unix ones theLFway. You can read more about these, here.
You can use the following (often recommended) command to change the default behaviour of git:
git config --system core.autocrlf false
What this essentially does is, it tells git to not worry about line endings at all; and it would be your responsibility to keep it all in check.
Also do note that autocrlf has no saying in the files that have already been committed. The changes that are in your repo, are going to stay that way.
You can read more about autocrlf here. Hope this helps! :)
Emil Moe
Senior Data Engineer