Add line break to git commit -m from command line on Windows

You can create multiline commit message like this:

C:\> git commit -m "Line 1"^
More?
More? "Line 2"^
More?
More? "Line 3"

Note, that the circumflex character is only on odd lines.


Either create a file that contains your commit message in the right format and use git commit -F <message_file>, after which you can continually edit and reuse that same file, or create a template file and use git commit -t <template_file> to open your editor with the pre-cooked template to be filled in. The second option can be made permanent by setting the commit.template configuration variable, so you don't need to use the -t ... bit on every commit. See the git commit manual page (git help commit, if your git is installed correctly, or search online) for more information.

Tags:

Windows

Git