Is it possible to insert code snippets, for example, from a browser window, if the git parameter is set to core.autocrlf false?

I am learning the best option autocrlffor GIT, and I am confused about what happens with the code inserted into the editor if it is set to false. I notice that many people recommend setting it to false, indicating that as long as the correct and correctly configured editors are used, then there should not be any problems, and I can understand this if I write ALL the code in the file; but I am confused about how this option will work if I copy a snippet, for example, from a browser, or maybe with some old code or something like that, or what if I used the whole old file . Of course, I could easily get mixed CRLF and LF, since some of the code I get could be CRLF and some LF? Or are the editors so smart that they themselves convert any inserted into the code when saving?

EDIT: I suppose I should also ask: is this really a problem if EOFs mix?

+3
source share
1 answer

The idea is to avoid any problems with EOF, use only editors:

  • able to detect current EOF style used by open file
  • you can save this file with the same EOF style (thus, the conversion is not saved)

In this way:

+1

All Articles