I've encountered a problem using the Git diff. For some reason, it seems to be misreading the files I change and the first letter of each line is put in the modified (+/-) line, like so:
This happens both on my app and my remote repo!
At first, I thought it was possibly an error with the file not being able to be read because of the ! defined ('BASEPATH')
line, but this also occurs on files without this check, and also on my project's JS files. It reads perfectly on CSS, HTML and certain PHP files.
Perhaps I have something set up wrong, although this is the first repo I've had where I have ever had this problem. I don't know what information you'll need to know but if you require anything, please let me know and I will find out for you.
EDIT: The "FileMerge" tool shows the changes perfectly, if that helps.
FIX
This was, as KurzedMetal pointed out, a problem with Mac/Windows line endings. This is the fix I have used for the time being to convert the line endings for the time being. It's not perfect, and if someone can suggest a better (ideally, recursive) function I'd be happy to accept it.
perl -pi -w -e 's/\r\n|\n|\r/\n/g;' *.php
I've had to do this for each subdirectory, e.g.
perl -pi -w -e 's/\r\n|\n|\r/\n/g;' */*.php