1

When I type 'git diff filename' it highlights all of my code in green (I did modifications to my file and CMD+S to save changes and test multiples times) instead of just the new lines... Anybody can help? Thank you guys

3
  • can you provide the results of a git status and the filename? Commented Jun 21, 2019 at 16:51
  • @Maus / filename is index.html / On branch master Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: index.html no changes added to commit (use "git add" and/or "git commit -a") Commented Jun 21, 2019 at 16:56
  • Could it be that the DOS/linux line ending format has changed? You could try a dos2unix or unix2dos and see if the diff changes to just the modified lines. Commented Jun 22, 2019 at 1:12

1 Answer 1

2

there was a change in ELF format. The old flags to control this are a mess. The best thing you can do is set git to not mess with it by adding * -text to gitattributes. Set the files to their original EOL format (amend if it's already commited) and then everything should be back to normal.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for your response; I just had to "git add index.html" again and it worked...