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