我今天這樣打:爲什麼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沒有刪除它們呢?