I hit this today:
% 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, so I'll remove untracked files:
% git clean -f
Not removing alembic/
Not removing tools/maintenance/
However, it seems that not all untracked files have been removed:
% 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
What's weird is that at first git checkout another_branch git knew about those particular untracked files it later complained about (alembic/README, alembic/env.py, alembic/script.py.mako).
So why git did not delete them?