When I commit with a message on the command line, I think I'm only able to add a subject line. Is there a way to add a commit body through command line?
And git will open up your favorite editor (it defaults to $EDITOR I think) and you can put in a subject and body there. You separate them by a newline.
You can use the -e or --edit option which will open your configured editor.
You can also use the -m option multiple times and the text will be concatenated as separate paragraphs.
Another method is to pipe the comment to a file and use either the -F <file> or --file=<file> option.
Running git help commit should show you all the possible options.
HTH
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
When I commit with a message on the command line, I think I'm only able to add a subject line. Is there a way to add a commit body through command line?
I guess you do something like
Instead you can do
And git will open up your favorite editor (it defaults to
$EDITORI think) and you can put in a subject and body there. You separate them by a newline.You can use the
-eor--editoption which will open your configured editor.You can also use the
-moption multiple times and the text will be concatenated as separate paragraphs.Another method is to pipe the comment to a file and use either the
-F <file>or--file=<file>option.Running
git help commitshould show you all the possible options.HTH