如果某个文件没有被跟踪,Git如何告诉我它已经发生了变化?当它被发现为未跟踪时,它又如何被删除呢?
$ git status
On branch updated-code-foundation
Your branch is ahead of 'origin/updated-code-foundation' by 16 commits.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: component/portal/src/Joppli/Acl/AclInterface.php
deleted: container/php-apache/config/apache/default.conf
deleted: container/php-apache/config/php/php.ini
Untracked files:
(use "git add <file>..." to include in what will be committed)
component/portal/src/Joppli/Acl/AclInterface.php
container/php-apache/config/
我通过执行
git add .
(无需提交)来解决这个问题。
- 为什么会出现这种情况?
- 我该如何避免这种情况的发生?