Search code examples
gitvimline-endings

^M characters in git commit message (git commit -v)


I am having a weird problem where lots of ^M characters show up in my git commit message. Please find a screenshot attached. This is not causing any problems, just makes it annoying to read through.

enter image description here

Tips appreciated.


Solution

  • "The Proper Way", if you use Git in cross-platform environment, contrary to Abhijeet's answer, is:

    Learn and CORRECTLY configure core.autocrlf settings in each client

    Read local topic "Why should I use core.autocrlf=true in Git?" as good starting point