How to add a long description in git

I am running git with help git commit -m 'commit message', but this only has a short description. How to add a more detailed description using git bash?

+4
source share
6 answers

You can specify several options -m:

git commit -m 'foo bar' -m 'baz qux'

git log will display several paragraphs:

commit ...
Author: ...
Date:   ...

    foo bar

    baz qux
+3
source

How about this?

git commit -F - <<EOF
summary

This is
a multi-line
commit message.
EOF
+4
source

, git commit, ?

. Git $GIT_EDITOR, core.editor, $VISUAL , , $EDITOR. git-var , git-config core.editor.

+4

long commit . , :

  git commit -F <path/to/file>

: https://www.kernel.org/pub/software/scm/git/docs/git-commit.html

, !

+1

man git commit:

-m <msg>, --message=<msg>
Use the given <msg> as the commit message.
If multiple -m options are given, their values
are concatenated as separate paragraphs.

, :

git commit -m "Subject" -m "paragraph 1" -m "paragraph 2"
0

,

-F "file", --file = "file"           .   -           .

0

All Articles