You just use the following command:

$ git commit -m "1. what i changed
> 2. blank line
> 3. why i changed"

In your terminal, just hit 'enter' for a new line. The commit message won't end until you add the closing quote. The git log will look like:

$ git log
commit abcde2f660c707br2d20411581c4183170c3p0c2
Author: Alex Pan <[email protected]>
Date:   Tue Apr 28 20:52:44 2015 -0700

    1. what i changed
    2. blank line
    3. why i changed
Answer from Alex Pan on Stack Overflow
🌐
Reddit
reddit.com › r/git › is it good or bad practice to write multi-line commit messages?
r/git on Reddit: Is it good or bad practice to write multi-line commit messages?
November 16, 2022 -

Looking for some advice here.

I have done a lot of reading on writing good git commit messages. Use imperative mood, 50 characters max for the first line, capitalize the first letter, no period at the end, etc. These make sense and I follow all these guidelines.

The one thing I don't really do is commit often. That's because I am working alone, mainly on my dotfiles and scripts. I understand if you are writing a piece of software or doing web dev, you should commit often, but for me that seems overkill. Should I really git commit if I just change something as simple as hex code for a background? I don't think so.

What I have been doing is writing multi-line commits.

For example (without hyphens):

  • Create directory if it doesn't exist

  • Fix bug in script

  • Remove unused aliases

  • Change background colour to orange

I figure this is better than a single message saying something like... "Minor changes", which is discouraged.

On Github, the first line will be shown as the commit message with 3 dots or ellipsis at the end. If you press the dots, it shows the remaining 3 lines. I could just do it all in one line, but then it will wrap at the character limit, and not look very nice. I think in-line messages look far better, even if you can't see it all at once.

What is your opinion?

Discussions

bash - How to add line break to 'git commit -m' from the command line? - Stack Overflow
Separate -m for each line. Nice! 2012-04-17T20:26:01.14Z+00:00 ... Messages created using this method display correctly on GitHub, GitHub for Windows and TortoiseGit. 2013-03-27T12:06:54.14Z+00:00 ... @ddotsenko this is the benefit of working on Linux / Mac, where we have a decent shell =) 2014-01-28T10:28:12.913Z+00:00 ... From man git commit: -m , --message= Use the given as the commit message. If multiple ... More on stackoverflow.com
🌐 stackoverflow.com
Can you create a multi-line commit?
For this dialog box, Enter simply accepts the single line commit message and records the commit with Git. The other dialog box has two input areas: one for single line comment and the other for multi-line comment. More on github.com
🌐 github.com
1
1
Git commit accepts several message flags (-m) to allow multiline commits
So that might sometimes be good enough for a first automatic commit message. I typically clean the history before I submit I submit my work to review · autoload -z edit-command-line zle -N edit-command-line bindkey "^X^E" edit-command-line [1] https://unix.stackexchange.com/questions/6620... More on news.ycombinator.com
🌐 news.ycombinator.com
152
339
July 9, 2020
Pasting multiple lines into commit summary field executes commands
Describe the bug When pasting multiple lines into commit summary field, any characters on lines after the first line will be executed as commands. To Reproduce Steps to reproduce the behavior: Stag... More on github.com
🌐 github.com
9
December 8, 2023
🌐
DEV Community
dev.to › zacharylee › how-to-commit-multiline-messages-in-git-commit-1ap3
How to Commit Multiline Messages in git commit - DEV Community
June 2, 2024 - -F — file= Take the commit message from the given file. Use - to read the message from the standard input. So you can write a multi-line message in a temporary file before committing.
🌐
GeeksforGeeks
geeksforgeeks.org › git › how-to-add-line-break-to-git-commit-m-from-the-command-line
How To Add Line Break To 'git commit -m' From The Command Line? - GeeksforGeeks
July 23, 2025 - To add a line break to a git commit -m message from the command line, you need to use the -m flag multiple times, once for each paragraph.
🌐
Medium
medium.com › @vitoriodachef › a-decade-of-multi-line-commit-messages-fe43ecc81ad3
A Decade Of Multi Line Commit Messages | by Victor Todoran | Medium
August 6, 2024 - The answer is pretty straight forward, you just write git commit -m " and then press enter for new line. When you are finished you close the quotes and press enter again. Easy peasy.
🌐
Web Developer
webdeveloper.beehiiv.com › p › commit-multiline-messages-git-commit
How to Commit Multiline Messages in git commit
October 29, 2025 - But sometimes a multi-line message ... changed Commit Description: Detailed instructions for changing it ... Use git commit without the -m or git commit -v, which will take you to a text editor. So then you can add multiple lines ...
Find elsewhere
🌐
Stefan Judis
stefanjudis.com › today-i-learned › git-commit-accepts-several-message-flags-m-to-allow-multiline-commits
git commit accepts several message flags (-m) to allow multiline commits | Stefan Judis Web Development
July 8, 2020 - Edited: Several people pointed out that you can achieve the same commit structure including a title and body (multiple lines) by opening quotes, pressing enter and closing the commit with quotes again. git commit -m "commit title > > commit ...
🌐
DEV Community
dev.to › behainguyen › windows-10-multi-line-git-commit-messages-3je6
Windows 10: multi-line Git Commit messages. - DEV Community
February 16, 2023 - Each message is enclosed within a pair of double quotes, i.e. "function runAjax( method, ..., errorCallback )."^. There is a caret ^ character at the end of each line, except the last line. THERE MUST BE NOTHING ELSE AFTER THE caret ^ character. A single space did cause a problem for me. ""^ inserts a blank line into the Git commit description.
🌐
Hacker News
news.ycombinator.com › item
Git commit accepts several message flags (-m) to allow multiline commits | Hacker News
July 9, 2020 - So that might sometimes be good enough for a first automatic commit message. I typically clean the history before I submit I submit my work to review · autoload -z edit-command-line zle -N edit-command-line bindkey "^X^E" edit-command-line [1] https://unix.stackexchange.com/questions/6620...
🌐
pawelgrzybek
pawelgrzybek.com › multi-paragraph-git-commit-messages-cli-and-visual-studio-code
Multi-paragraph git commit messages (CLI and Visual Studio Code) | pawelgrzybek.com
September 11, 2020 - Turns out there are multiple ways of doing it using CLI and also my favourite code editor Visual Studio Code. Presumably, git CLI is the most common way to interact with this version control system. I found three different methods to achieve multi-paragraph commit message using this method. git commit -m 'Line one' -m 'Line two' -m 'Line three'
🌐
GitHub
github.com › jesseduffield › lazygit › issues › 3151
Pasting multiple lines into commit summary field executes commands · Issue #3151 · jesseduffield/lazygit
December 8, 2023 - Describe the bug When pasting multiple lines into commit summary field, any characters on lines after the first line will be executed as commands. ... Stage a change. Open the commit form (c). ... Expected behavior Only the first line is used.
Author   OliverJAsh
🌐
Apache
lists.apache.org › thread › jkqy4vpvkrsm353oj4bvmjtvz42mf2hp
Re: How to make a multi-line commit message with git?
Email display mode: · Modern rendering · Legacy rendering · This site requires JavaScript enabled. Please enable it
🌐
GitHub
gist.github.com › mrliptontea › 4e594492147d71ccc69571ae16dd0e7c
Writing good commit messages · GitHub
Just like with the Single ... logical changes or bug fixes. Split it up into several commits using git add -p or using a GUI such as GitHub desktop. Typing multiline commit messages ......
🌐
Linux Hint
linuxhint.com › make-git-commit-messages-divide-into-multiple-lines
How Can I Make Git Commit Messages Divide Into Multiple Lines – Linux Hint
To make Git commit messages divide into multiple lines, use the “Enter” key in the terminal or use the “-m” option multiple times in the “git commit” command.
🌐
Git
git-scm.com › docs › git-commit
Git - git-commit Documentation
Determine how the supplied commit message should be cleaned up before committing. The <mode> can be strip, whitespace, verbatim, scissors or default. ... Strip leading and trailing empty lines, trailing whitespace, commentary and collapse consecutive empty lines.
🌐
camdez
camdez.com › blog › 2022 › 12 › 13 › git-quick-multi-line-commit-messages
git: Quick Multi-Line Commit Messages · camdez
December 14, 2022 - I don’t know why I’m quite so tickled by this, but today I learned that you can make multi-line git commit messages by passing multiple -m arguments: