git diff, shows the same line as both deleted and added
In addition to spaces/tabs, line endings when entered from different editors (even on Windows) and/or different OSs can contribute to diff lines showing duplicates; LF (linux/Unix) vs CRLF (Windows).
Check spaces. The replaced "empty" looking lines have spaces in them. You may also have accidentally replaced tabs with spaces or vice versa.
It's probably whitespace changes. You can run git diff -w
, which will ignore any whitespace changes.
Check for spaces or line ending differences.