I just read Writing good commit messages and liked it a lot. The problem is, I prefer the command line (plain ole' git
).
For newline, just hit enter inside quotes, like this: git commit -m "Some headline <hit enter>
. Also you can use your text editor to write commit messages.
Unfortunately no, e.g. this commit with markdown for example.
git
automatically spawns your preferred $EDITOR
to prompt for a commit message when you run git commit
. So it may be as simple as leaving -m
off of your git commit
command
If git launches the wrong editor, or fails to launch an editor, try setting the EDITOR
environment variable to your preferred editor:
export EDITOR=/usr/bin/vim
Or, to only change the editor used by git, you can set core.editor
git config --global core.editor /usr/bin/vim
Using an editor to compose a commit message this way has a couple of further advantages. Git populates the file you are editing with a summary of the files that were changed in the commit, which should help you write a better commit message. Also, vim (and other editors) support basic syntax highlighting for this kind of file, making it even easier.
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