Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add long description in git

Tags:

git

I'm commiting to git using git commit -m 'commit message', but this only has the short description. How would I add the more detailed description using git bash?

like image 322
Jimmt Avatar asked Sep 29 '13 05:09

Jimmt


People also ask

Can a commit message be too long?

One of the limitation in creating a Git commit description is that it is limited to 50 characters, which sometimes is not much for a breakthrough changes in our code.


2 Answers

Did you know you can just type git commit and it will pop open an editor for you to write your commit message in?

You can control which editor it is with some configuration. By default, Git will look at $GIT_EDITOR, then the core.editor configuration variable, then $VISUAL, and finally $EDITOR. You can look at the git-var man page for the search order, and the git-config has a little information in the core.editor section as well.

like image 90
John Szakmeister Avatar answered Sep 28 '22 00:09

John Szakmeister


You can specify multiple -m options:

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

git log will show multiple paragraphs:

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

    foo bar

    baz qux
like image 24
SheetJS Avatar answered Sep 28 '22 01:09

SheetJS