0

I've noticed a weird behavior in VSCode, when I save a file, even if I don't make any change, I can see in the low right corner that it changes from CRLF to LF. Even if I make several changes, git tracks extra lines as being added and deleted at the same time.

I'm working on Windows, and so far I had no issue, it started happening just now. I've tried setting the global setting in VSCode for EOL to CRLF, and the Prettier extension also to CRLF (since I cannot disable it), but the issue remains.

I'm new at this, couldn't find similar issue online, just instructions how to set CRLF.

1 Answers1

0

I had some problems like that, because I work in a team that have UNIX and Windows environments. I use Windows, but all files of the project was saved in repositorie as LF eol. In your case (Windows environment) you need garantee the default behavior of Git:

git config --global core.autocrlf true

With that, Git will try to change eol of files to CRLF in operation like (new branch, clone etc.). Even, you could try to add "files.eol": "\r\n" on your user/workspace settings on VSCode, then your IDE will user CRLF as default (new files, new lines).