如何完成 git 提交?
how do I complete a git commit?
我输入 'git -commit' 并在我的终端上得到以下内容
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
#
# Initial commit
#
# Changes to be committed:
# new file: index.html
# new file: index3.html
#
# Changes not staged for commit:
# modified: index.html
#
# Untracked files:
# index2.html
#
现在我卡在了这个屏幕上,我不知道该怎么做才能完成提交,然后return回到终端的目录区域继续 cmd 中的其他任务。求助!
您需要向您的提交提供一条消息,指定该提交的作用,您需要做的是 git commit -m "here you write your message"
顺便说一句,这是一篇关于 git 提交消息的非常好的文章:http://chris.beams.io/posts/git-commit/
一个好的提交信息比你想象的更重要;D
这是一个文本编辑器,可能是 vi 或 vim。
您可以按 i 键进入插入模式并输入您的提交消息,完成后 escape,然后 ZZ(两次,大写)退出。
或者,您可以使用 -m
选项将提交消息放入命令行。
文本编辑器有一些不错的功能,例如可以轻松输入新行等。如果 vi 不适合您,您可以使用 git config --global core.editor <editorname>
将您的编辑器更改为更适合您的编辑器喜欢。
这与 git 无关,但与配置的文本编辑器有关。在 vim 中,您可以 press i
开始输入文本并通过按 esc and :wq
保存,这将提交您输入的消息。
在上述状态下,要退出而不提交,您可以执行 :q
而不是上面提到的 :wq。
我输入 'git -commit' 并在我的终端上得到以下内容
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
#
# Initial commit
#
# Changes to be committed:
# new file: index.html
# new file: index3.html
#
# Changes not staged for commit:
# modified: index.html
#
# Untracked files:
# index2.html
#
现在我卡在了这个屏幕上,我不知道该怎么做才能完成提交,然后return回到终端的目录区域继续 cmd 中的其他任务。求助!
您需要向您的提交提供一条消息,指定该提交的作用,您需要做的是 git commit -m "here you write your message"
顺便说一句,这是一篇关于 git 提交消息的非常好的文章:http://chris.beams.io/posts/git-commit/ 一个好的提交信息比你想象的更重要;D
这是一个文本编辑器,可能是 vi 或 vim。
您可以按 i 键进入插入模式并输入您的提交消息,完成后 escape,然后 ZZ(两次,大写)退出。
或者,您可以使用 -m
选项将提交消息放入命令行。
文本编辑器有一些不错的功能,例如可以轻松输入新行等。如果 vi 不适合您,您可以使用 git config --global core.editor <editorname>
将您的编辑器更改为更适合您的编辑器喜欢。
这与 git 无关,但与配置的文本编辑器有关。在 vim 中,您可以 press i
开始输入文本并通过按 esc and :wq
保存,这将提交您输入的消息。
在上述状态下,要退出而不提交,您可以执行 :q
而不是上面提到的 :wq。