'git' Multiline Commit Messages

Actually, if you just enter the command git commit, an editor is opened where you can enter the commit message.

Alternatively, you can use the -m parameter to specify a commit header message at the command line, or even multiple -m parameters to add several paragraphs. However, this doesn't easily let you insert line breaks in at specific positions of a paragraph.

The following command can be used to "edit" a commit message on the command line, or in a script file:

git commit -F- <<EOF
Header of the message

Body of the message
with preformatted line breaks.

This is also suitable to specify a message for an annotated tag.

Martin Burnicki martin.burnicki@burnicki.net, last updated 2022-08-10

  • miscellaneous_tips/20_software_development/git_notes/git_multiline_commit_messages.txt
  • Zuletzt geändert: 2022-08-10 18:11
  • von martin