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

My company has a policy that all checkins to a particular project must follow a specific multi-line template for git commits. How can I most simply create a single commit message that has multiple lines from the command line in Windows?

This is almost exactly a duplicate of “Add line break to git commit -m from command line” except that this question is specific to Windows/cmd.exe, while that question is related to bash.

  • Checkout from non-working branch and want to rebase to master
  • Git - recover intermediate commits after squash
  • git error: unable to index file FacebookSDK.framework/Headers
  • Why do I sometimes get `lock': deadlock detected (fatal) error?
  • Git only clones .git folder. Not all files
  • How do I prevent git from thinking new directories are part of the working tree?
  • How can the commit stats show negative total line count?
  • Using a git subrepo which has ANOTHER git subrepo in a mercurial repository, is this possible?
  • use git smudge/clean to replace file contents
  • any way to obtain the “dot git” (.git) directory from a github repository?
  • After GIT merge I still have the old branches
  • Push to another branch with git
  • 3 Solutions collect form web for “Add line break to git commit -m from command line on Windows”

    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.

    You can create multiline commit message like this:

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

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

    You can also use interactive rebase and then reword for editing the commit’s message.

    Type git commit -m "doesnt really matter whats here" and then git rebase -i HEAD~1, replace pick with r or reword, save and then edit the message.

    Git Baby is a git and github fan, let's start git clone.