当我做 agit 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/
那些未跟踪的文件是什么意思?所有的变化都确实被跟踪了。我不明白为什么 git 在这里警告我未跟踪的文件。
编辑:
好吧,我看到很多困惑的回复。这就是我之后发生的事情git commit -a
。
# On branch master
nothing to commit (working directory clean)
如您所见,除了应用了更改的这四个文件之外,没有其他内容。
我的问题应该改写如下:当这个提交中的所有更改都已被跟踪时,为什么 git 会警告我有关未跟踪的文件?
换句话说,git commit 消息中未跟踪的警告是否不必要?