git通配符 - 删除一个子目录的所有实例 [英] git wildcard - remove all instances of a subdirectory
本文介绍了git通配符 - 删除一个子目录的所有实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图执行 git rm --cached -r <文件夹>
来递归删除一个名为.svn的文件夹的所有实例。我已经试过这个:
$ $ p $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ b /*/*/.svn
等
但我确信有一个更动态的方法。
谢谢
解决方案
正确的解决方案是:
find。 -type d -name'.svn'-print0 | xargs -0 git rm --cached -r -
。
I am trying to execute git rm --cached -r <folder>
to remove all instances of a folder named .svn recursively. I have tried this:
.svn
/.svn
/*/.svn
/*/*/.svn
etc
And it works, but I'm sure there is a more dynamic way.
Thanks
解决方案
The right solution would be:
find . -type d -name '.svn' -print0 | xargs -0 git rm --cached -r --
@gregor's will fail on the directories with spaces.
这篇关于git通配符 - 删除一个子目录的所有实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文