How to replace crlf with lf in a single file
In Notepad++ on the bottom panel on to the Right, right click on the area Windows (CR LF) and select UNIX (LF) this should replace all CRLFs with LFs
Below is the setting in IntelliJ at the bottom right
Below is setting for VsCode at the bottom right
The git installation on windows usually includes the dos2unix
tool.
dos2unix <file>
But in your case you should use .gitattributes
to prevent the file from being converted on windows.
A .gitattributes
file can look like this
*.vcproj eol=crlf
*.sh eol=lf
From the .gitattributes documentation
Set to string value "lf"
This setting forces Git to normalize line endings to LF on checkin and prevents conversion to CRLF when the file is checked out.
Just commit the .gitattributes
file and your file will be checkout out on every system with LF
line ending.