Pierre Burton
Pierre Burton

Reputation: 2084

Prevent VSCode to CRLF files

I'm working on a Windows device within a team using MacOS and Linux or WSL.

I've set my Eol settings to LF to match the configuration of my teammates, but every time I checkout to another branch or discard changes from git, some files always end up converted to CRLF. I then have to manually reset that file to LF, or run a lint --fix, then git add --renormalize . to clean my git status.

Is there a way to prevent that from happening ?

Upvotes: 4

Views: 5757

Answers (1)

Pierre Burton
Pierre Burton

Reputation: 2084

* text=auto eol=lf in .gitattributes did the trick.

Upvotes: 7

Related Questions