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.
Tips appreciated.
The most common option used with git commit is the -m option. The -m stands for message. When calling git commit , it is required to include a message. The message should be a short description of the changes being committed. The message should be at the end of the command and it must be wrapped in quotations " " .
The defaults are 50 characters for the summary and 72 characters for the description, as recommended by the git tutorial and expanded upon by Tim Pope. commitmessage. maxSubjectLength : Maximum length of the commit message's subject line. Defaults to 50 if not specified or less than 0.
Here's a short background about git commit hashes and short commit hashes: A commit in git always has a hash that contains 40 characters.
Use Markdown to format your text. Some tools like GitHub will render Markdown when showing commit messages. Use asterisks bullets when you need to explain a long list of changes.
"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
Thats a windows newline. Newlines in and windows & linux are different.
You can remove it using dos2unix.
Various ways of doing it: http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With