When I use git log
to check out my commit explanatory note I want it to look like this:
1. what I changed 2. blank line 3. why I changed it
...being in 3 lines not 1 like this:
1. what i changed 2. blank line 3. why i changed
However, git log
shows it in one line. So, how do I get this to happen using git commit -m
?
On the command line, navigate to the repository that contains the commit you want to amend. Type git commit --amend and press Enter. In your text editor, edit the commit message, and save the commit.
Git commit -m does not accept spaces in the message [closed] Bookmark this question.
To change the most recent commit message, use the git commit --amend command. To change older or multiple commit messages, use git rebase -i HEAD~N . Don't amend pushed commits as it may potentially cause a lot of problems to your colleagues.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With