0

My projects that are programmed in Ubuntu, where VSCode is configured in LF work perfectly.

When I clone on Windows even with the .editorconfig configured only for lf, it modifies the entire code of a file when saving, needing to commit the files again just because it reconfigured the lf.

The problem is that I have already configured editorconfig, vscode, git global to lf and nothing solved, whenever saved it modifies the file.

I use eslint, prettier and editorconfig in the code. I wanted a solution to be able to program on both operating systems.

itamazor
  • 1
  • 1
  • Pls try [my suggestions](https://stackoverflow.com/a/59644154/3700414) . First with new repos. Then move on to cleaning pre-existing messed-up ones! – Rusi Oct 04 '20 at 06:30

1 Answers1

0

When installing Git for Windows it asks you how you want to handle this situation (line endings). Usually it gives 3 options. Once you choose one, every time you clone a repo it applies that option.

So, say the repo uses LF and you specified that you want to use CRLF during your Git installation, it will make all the files CRLF.

I am not sure if that option is configurable post install. You can uninstall Git and reinstall it and you'll see that option. From there, if you Unix is your primary development environment I would say choose the option that says "Check out Unix style, commit Unix style".

Dharman
  • 30,962
  • 25
  • 85
  • 135
MkMan
  • 1,779
  • 1
  • 14
  • 27