Identify files with difference line endings on local vs remote

Viewed 39

UPDATE: Compared with the suggested SO thread there are no warnings. There are files in my repo which are not in remote and I was looking for a way to identify every file in local which is not in remote due to possible incorrect line ending issues

I have a file in local master and it's not found in origin/master, looks like it's ignored due to line endings.

For example when I modified the file and tried to commit/push, I got an error

warning: LF will be replaced by CRLF in assets/js/main.js.
The file will have its original line endings in your working directory

I tried git config core.fileMode false to force it to ignore line ending and followed the solution here Can't fix line endings issue on git but it didn't help

Is there a way to discover all of the files on local which are NOT in origin/master due to this line ending mismatch?

1 Answers

As per Vasiliy's suggested SO thread Git replacing LF with CRLF

I did the following:

  • Set the core.autocrlf to true (most often used method which converts automatically so people on Windows and Mac machines can work on repo files together)
  • Re-added all the files to repo with renormalize setting: git add . --renormalize
  • This time it detected changes so I was able to commit and push
Related