Git/GitHub commit with extended message/description

GitGithub

Git Problem Overview


I recently use GitHub and downloaded GitHub for Mac.

I noticed you can add an 'extended description' using GitHub for Mac. How do I add an extended description using the command line?

Can I add an extended description to an existing commit?

Git Solutions


Solution 1 - Git

Run git commit without a message and it'll open up your favorite* text editor to write a commit message. Details on the format of the message will appear in the sample.

First line is the short description. Leave a blank line after it. Everything else is the extended description.

*: for some values of "favorite"; results may vary

Solution 2 - Git

From this accepted answer:

git commit -m "Title" -m "Description .........."

Solution 3 - Git

Actually, you can do this quite easily from the command line. The trick is to type your message (without a closing quote!) and then hit enter twice, and then type your extended message, close the quote and press enter.

It should look like:

$ git commit -m "Make everything work.
dquote>
dquote> Add magic code that fixes everything"

GitHub will correctly display the top line as your basic message and the bottom line as the extended message.

The following does NOT work. You end up with the literal "\n\n" in the commit message: $ git commit -m "Basic msg\n\nExtend msg, doesnt work".

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAdrian GunawanView Question on Stackoverflow
Solution 1 - Gituser149341View Answer on Stackoverflow
Solution 2 - Git1j01View Answer on Stackoverflow
Solution 3 - Gitstephen.hansonView Answer on Stackoverflow