如果没有跟踪,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 .
解决了这个问题(无需提交......)
答案 0 :(得分:3)
1。该方案如下:
git rm
文件示例:
git add myfile
git commit -m "myfile"
git rm myfile
echo test > myfile
git status
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: myfile
Untracked files:
(use "git add <file>..." to include in what will be committed)
myfile
2. 我不知道如何防止它,因为它取决于文件是什么。 可能是文件是自动生成的,有人错误地提交了文件,然后试图删除它们。
他们可能属于.gitignore
?
答案 1 :(得分:1)