0

I set LF using IDE interface (Settings/Preferences | Editor | Code Style), but all files from the repo (all files have LF line ending) automatically converted to CRLF separators.

How to fix automatic conversion of all line breaks to CRLF on Windows and use LF only?

enter image description here

enter image description here

enter image description here

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Nikolay
  • 211
  • 2
  • 11
  • 1
    1) What is SRLF? Did you actually mean CRLF? 2) If you actually pay attention to your the screen on your first screenshot, you will notice "Applies to new files" text. That mean: to NEW files created by IDE only. – LazyOne Jun 22 '20 at 11:54
  • 1
    3) If you need to convert line ending for an existing file using IDE, do that via status bar (click on `LF` on your 2nd screenshot) -- this will do for the currently opened file (you may need to hit Save to it gets saved to the disk). For batch convert (few files/folder at one): select desired files/folder in Project View panel and then use `File | File Properties | Line Separators` from main menu. – LazyOne Jun 22 '20 at 11:57
  • 1
    4) If such conversion happens automatically (i.e. in repo it has one line ending and once cloned/checked out it has different one) then check your git settings (e.g. https://stackoverflow.com/a/33196751/783119) – LazyOne Jun 22 '20 at 12:00
  • @LazyOne ahah. Ye, CRLF. Im check git settings.. – Nikolay Jun 22 '20 at 12:04
  • @LazyOne after edit and safe any file, line break fixed on this file. I think git swithed linen automaticty on checkout to CRLF.. – Nikolay Jun 22 '20 at 12:07

0 Answers0