好的,所以我 fork 了一个项目,运行了 git pull upstream master
命令,然后 git 状态显示工作目录干净。接下来我从项目中运行了一些测试。
现在,git status
显示:
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# activemodel/log/
现在,
$ git clean -d -f -n
显示:# Would remove actionpack/test/temp/
# Would remove activemodel/log/
这些只是用于日志文件的目录,但我很好奇为什么
actionpack/test/temp/
在git clean dry run
中出现,但没有出现在git status
中。如果所有未跟踪的文件都不显示在git status
中,则可能会导致问题,然后git clean
会删除您没有意识到的文件。有人知道这是为什么吗?
activemodel/log/
有一个空的测试和开发文件,而actionpack/test/temp
没有文件。它是一个空目录,所以在git status
中不会显示。现在我明白了。谢谢。 - fontno