How to change EOL for all files from CLRF to LF in Visual Studio Code

Thong Yi Xuen picture Thong Yi Xuen · Mar 12, 2018 · Viewed 21.4k times · Source

I had change the default EOL from CRLF to LF, but this only applies to the new files. I would like to know how to change the EOL for all the files at once as I have more than hundred of files and it will be hard to do it manually.

Answer

Brandon Truong picture Brandon Truong · Nov 26, 2018

Run these. It works for me. Customize it with your requirements

git config core.autocrlf false 
git rm --cached -r . 
git reset --hard