Add line break to 'git commit -m' from the command line Add line break to 'git commit -m' from the command line bash bash

Add line break to 'git commit -m' from the command line


Certainly, how it's done depends on your shell. In Bash, you can use single quotes around the message and can just leave the quote open, which will make Bash prompt for another line, until you close the quote. Like this:

git commit -m 'Messagegoeshere'

Alternatively, you can use a "here document" (also known as heredoc):

git commit -F- <<EOFMessagegoeshereEOF


If you just want, say, a head line and a content line, you can use:

git commit -m "My head line" -m "My content line."

Note that this creates separate paragraphs - not lines. So there will be a blank line between each two -m lines, e.g.:

My head lineMy content line.


Using Git from the command line with Bash you can do the following:

git commit -m "this is> a line> with new lines> maybe"

Simply type and press Enter when you want a new line, the ">" symbol means that you have pressed Enter, and there is a new line. Other answers work also.