-2

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?

Robert Sinclair
  • 4,550
  • 2
  • 44
  • 46
  • Can you explain what you mean by "it's not found in origin/master" ? what thing do you look at to establish that ? – LeGEC Sep 16 '22 at 13:02
  • Not sure what you are asking. It's not ignoring the file, it's ignoring the differences in line endings used for purposes of determining if the file has changed. – chepner Sep 16 '22 at 13:02
  • A warning is not an error. I move past this one regularly. Why didn't your configuration work? That's the key. – isherwood Sep 16 '22 at 13:14
  • [`core.fileMode`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-corefileMode) is not about line endings at all. – phd Sep 16 '22 at 13:25
  • @VasiliyVanchuk helped answer it yes, thank you! – Robert Sinclair Sep 16 '22 at 14:11

1 Answers1

-1

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
Robert Sinclair
  • 4,550
  • 2
  • 44
  • 46