i am sure *.lib is in .gitignore
cat .gitignore | grep lib
*.lib
$ ls lib
TLib.lib TLib_d.lib
$ git status
# On branch master
nothing to commit (working directory clean)
$ git clean -dfX
$ ls lib
TLib.lib TLib_d.lib // the issue is here...
why these .lib files are not deleted?
Git stops searching files, once it encounters a directory not in the index. But in the case above, we are telling git to search all files matching ignore pattern. So, it’d better go in to all directories and search files.
This will also match
git ls-filesbehavior. Given:Run following commands.
The last command does not print any files. But it would be nice if it did: