I'm using Git Bash on Windows and, when I run git commit
, the vi editor opens to allow me writing a Commit note. I noticed that the first row of the text I write is yellow (although not all of it, only the first 30 or 40 characters), the second is white on a red background and from the 3rd onwards they are gray. Does this colour coding mean anything, or is it just some sort of weird glitch? I come from an SVN background, where Commit comment was pure text and I wasn't expecting this "rainbow". :)
Thanks in advance for the answers.
Add/Commit All By using the -a flag when committing you are telling Git to add all files that have been modified and then commit them. This runs into issues with new files, though. Since the -a flag only adds modified files it will not add new files or deleted files.
It is up to you. Just use the commit message as you wish. But it is easier if you are not switching between times and languages. And if you develop in a team - it should be discussed and set fixed.
Perhaps the most common flag used with git commit is the -m flag. The -m flag, which stands for message, is used to add a commit message to a commit. When you use the git commit command without the -m flag, a text editor will be opened in which you can write a message, as we discussed earlier.
Vi is giving you a hint about "properly" formatting your commit message.
While there is no specific enforcement of one message style w.r.t. another, "traditionally" Git commit messages are structured this way:
The last paragraph is usually used for "metadata" entries, like Signed-off-by:
.
So, in your case, Vi is probably warning you that the first line is a a little longer than usual and that you did not leave a blank line after it (I say "probably" because I do not use Vi, so I am not sure about it).
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