Inconsistent Line Endings
Sometimes when I open up several of my projects I get a warning that says:
"The line endings in the following file are not consistent. Do you want to normalize the line endings"
I click Yes (defaults to Windows CR LF) & proceed to work on the program. Then I might open it up several days later & get the same warning.
What causes line endings to become inconsistent in the first place & why don't they stick when I say yes to normalize them?
Re: Inconsistent Line Endings
I've seen this, as well, in older ASP.NET WebForms projects that had been generated by a code generator. I always assumed that the cause was some result of the code generator. I opened those so infrequently that I never noticed that the change hadn't stuck until you mentioned it. Now that you mention it, I think the change didn't stick for me, either.
Re: Inconsistent Line Endings
Something is partially overwriting those files other than your code editor so the first order of business is to determine what that is.
Re: Inconsistent Line Endings
I get this all the time. The issue is compounded by the fact that developers are in different operating systems with differing environments. Some use Visual Studio, some use Visual Studio Code, and some use VIM. Each one of those setups can then further be configured with specific line endings.
Just about anytime I touch a file in any of our projects I will get that message and if I tell Visual Studio to fix the line endings then git will treat each line change as a change which understandably upsets the reviewers.
I've just been trained to tell Visual Studio to ignore it and move on anytime I open a file. I'm pretty sure that's just called learned helplessness though.