当我这样做时git commit -a,我看到以下内容:
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch better_tag_show
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: ../assets/stylesheets/application.css
# modified: ../views/pages/home.html.erb
# modified: ../views/tags/show.html.erb
# modified: ../../db/seeds.rb
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# ../assets/stylesheets/
# ../views/pages/ …Run Code Online (Sandbox Code Playgroud) 我注意到git允许直接提交跟踪文件(已在本地修改),而无需使用暂存,例如:
$ git status -s .
M myfile.txt
$ git commit myfile.txt -m"1 way"
Run Code Online (Sandbox Code Playgroud)
改为使用“经典”两个步骤更好吗?:
$ git add myfile.txt
$ git commit myfile.txt -m"2 way"
Run Code Online (Sandbox Code Playgroud)