Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 552
Pierre Burton Avatar asked Oct 25 '25 01:10

Pierre Burton


1 Answers

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

like image 80
Pierre Burton Avatar answered Oct 26 '25 14:10

Pierre Burton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!