问题
I have a folder foo
that is included in gitignore:
- .gitignore (this contains 'foo')
- foo
*
*** bar
When I run git clean -f
or git clean -f -x
, this does not delete bar (bar is a normal file).
Is there a way to tell git to clean inside ignored folders?
回答1:
git clean -fdx
will delete all untracked files, including directories. The -d
is necessary to cause the cleaner to descend into the untracked dir.
来源:https://stackoverflow.com/questions/9314190/git-clean-inside-ignored-folders