After cloning a git repository from Github, if I open a file, make no changes, and save the file, the following shows up in the output of git diff
:
-@import "sync.scss";
\ No newline at end of file
+@import "sync.scss";
As I understand it, \ No newline at end of file
is supposed to mark the end of the file when no newline is present. Does this diff mean git thinks the last line has been moved to after the end of the file? Is there any way to avoid this? I'd like to contribute to this project without adding junk whitespace changes to my commits.
This seems like an issue with line endings. I'm fairly confident the file was originally saved on a Mac using Unix line endings. That's the same setup that I'm using, so I'm not sure what is causing the document to change when I save it.