$ git status
# On branch masternothing to commit (working directory clean)
以上输出说明我们在最近一次提交之后,没有做任何改动,是一个"干净的工作目录"。
如果你没有设置 -m 选项,Git 会尝试为你打开一个编辑器以填写提交信息。 如果 Git 在你对它的配置中找不到相关信息,默认会打开 vim。屏幕会像这样:
# Please enter the commit message for your changes. Lines starting # with ‘#’ will be ignored, and an empty message aborts the commit. # On branch master # Changes to be committed: # (use "git reset HEAD
…" to unstage) # # modified: hello.php # ~ ~ “.git/COMMIT_EDITMSG” 9L, 257C
如果你觉得 git add 提交缓存的流程太过繁琐,Git 也允许你用 -a 选项跳过这一步。命令格式如下: