Git清理被忽略的文件夹 [英] Git clean inside ignored folders
本文介绍了Git清理被忽略的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含在gitignore中的文件夹 foo
:
- .gitignore(包含'foo')
- foo
*
*** bar
当我运行 git clean -f
或 git clean -f -x
时,这不会删除栏(bar是一个普通文件)。
有没有办法告诉git清理被忽略的文件夹内部?
<解决方案
-d
有必要让清理者进入未跟踪的目录。
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?
解决方案
git clean -fdx
will delete all untracked files, including directories. The -d
is necessary to cause the cleaner to descend into the untracked dir.
这篇关于Git清理被忽略的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文