1. 23
  1.  

  2. 10

    If you start writing a commit message with -m, then realize you want more paragraphs, editing at the command line is slower, or that escaping quotes is trickier, you can use -e to take what you have so far as a starting point in the editor.

    1. 8

      Or, I don’t know, do not use -m at all and it will open text editor for you?

      1. 4

        The use case of scripting commits is the first that comes to mind where you don’t want that, but might want multi-line commits.

      2. 3

        Interesting, though can’t say I’ve ever needed to use multiple -m flags.

        I’ve generally used the shell’s built-in multiline string syntax for this. Lead the string with either a ' or ", and the shell will continue parsing new lines as a part of the string until it’s closed.

        1. 2

          Someone mentioned this feature on a slack a few months ago and I’ve been using it ever since.

          It’s really nice because I can also use amend and move around the message using my vi keybindings without ever needing to drop into the editor. But at the same time I can do the summary/details split in my message.