我今天这样打:为什么git clean -f不会删除所有未跟踪的文件?
% git checkout another_branch
error: The following untracked working tree files would be overwritten by checkout:
__version__.txt
alembic.ini
alembic/README
alembic/env.py
alembic/script.py.mako
folder1/file1
folder2/file2
....
Please move or remove them before you can switch branches.
Aborting
OK,所以我会删除未跟踪文件:
% git clean -f
Not removing alembic/
Not removing tools/maintenance/
然而,似乎并不是所有的未跟踪的文件已被删除:
% git checkout another_branch
error: The following untracked working tree files would be overwritten by checkout:
alembic/README
alembic/env.py
alembic/script.py.mako
Please move or remove them before you can switch branches.
Aborting
奇怪的是,起初git checkout another_branch
git知道那些后来抱怨的特定未跟踪文件(alembic/README
,alembic/env.py
,alembic/script.py.mako
)。
那么为什么git没有删除它们呢?