If I want to not use any text editor and put all the commit message including subject and body lines into the useful one-line command:
$ git commit -m 'message including subject and body lines'
, I need to insert first body-line two lines after subject and the next lines just at the next new line.
For example:
feat: Derezz the master control program
So I tried to use "\n" but didn't solve the problem!
If you're working in Bash (on Linux or in Git Bash on Windows), then you can use the $'...'
syntax from Bash, which lets you use \n
and other escape sequences:
$ git commit -m $'message subject\n\nmessage body'
will create a commit with message
message subject
message body