What to do after typing in commit message for git?
After I type in git commit -a
a text editor pops up and I type in my comment. What buttons do I ha开发者_Go百科ve to press after typing in the comment, to get it to move to the next stage of actually committing?
I'm using mysysGit on Windows with the default setup.
try this:
git add file-name
git commit -m "here goes my awesome commit message"
git push
Save the file and exit your editor.
Depends on the text editor you are using. Git chooses the editor specified in the environment variable "EDITOR." On Linux systems this is usually either Vi or Nano. Figure out which it is and then refer to the documentation for the appropriate editor.
A git commit
always requires a comment. You can give one like this
git commit -m "my comment"
. If you do not provide a comment here, then a text editor pops up to force you to give a comment.
Sometimes, you may actually need the editor to put in the commit message. This generally is required when you want to give a more detailed description of the commit along with the summary (write the summary followed by a blank line followed by the description).
This is an extract from git help commit.
Though not required, it's a good idea to begin the commit message with a single short (less than 50 character) line summarizing the change, followed by a blank line and then a more thorough description. Tools that turn commits into email, for example, use the first line on the Subject: line and the rest of the commit in the body.
EDIT:
And after you type text in your text editor, just save and close it. If you try to do it without providing any comment, the commit will fail.
精彩评论