When I run git diff
on a PHP file that I have modified, it shows me the wrong line being modified and the other lines are 'unmodified' (no changes), even though I have modified the other lines.
An example:
This is the change I have made to the document:
It only occurs on certain files and on other occasions, it will sometimes add the other lines, but it does not mark the appropriate line deletions. On other occasions, it will just append the changes at the end of the file, without marking it as an addition.
On SourceTree, it seems that the same diff does not make any sense too:
FYI: The files were originally downloaded from a Linux server.