When I do normal line breaks using enter key on my Ubuntu 18 (Virtualbox), it always appeared fine in git - it never added ^M (which I learned is a version of a carriage return/line feed used by DOS). It randomly started adding them to my line breaks and I have no idea why and can't find a solution to get rid of them again.
Another helpful bit of info is that all existing edited line breaks do not show the ^M, only newly edited ones.
Editors tried: gedit, Visual Studio Code, Vim (CLI)
This is what git diff shows:
</div>
</form>
</div>
</div>^M
<!--^M
<ul class="nav navbar-top-links navbar-right">
<li>
<a href="#">