4 ms·
I don't really get people using git commit -m. I never do that. I always use just git commit and write my commit messages in vim that opens up in the same termi
by snitko 16y ago
I don't really get people using git commit -m. I never do that. I always use just git commit and write my commit messages in vim that opens up in the same terminal.
First of all, it allows you to easily write extended commit messages (just leave the second line blank and start writing the extended message on the third line). A good idea would be to leave (#more) anchor at the end of the first line, so that others would know there's actually some more info they might want to read.
Then you can always see the files currently being committed while you're in the editor, that's convenient. Last but not least - it helps me take my commit messages seriously.
- astine 16y agoOccasionally I'm using a terminal which can't open an editor for one reason or another. In those situations I use -m.
- koenigdavidmj 16y agoIf you need more than one line, you can say git commit -F - to specify that the commit message should be read from standard input.
- sh1mmer 16y agoI commit pretty frequently, so unless I'm merging in a large feature I tend to use git -m more often. That doesn't mean that I don't rebase a bunch of those smaller changes away before pushing them upstream it just means a lot of the changes I commit are small enough that it's easier not to load Vim to write a commit message.
- kyleslattery 16y agoEven better is to use `git commit -v`--it'll have a complete diff that you can review while writing your commit message
- deleted 16y ago[deleted]