0

所以我不小心提交了我的 eclipse .project 和 .settings 文件和目录。不是在命令行中遍历每个文件夹(大量文件夹),而是有一种方法可以遍历每个文件夹,如果找到这些文件/目录之一,运行 svn delete .project?

我在想类似的事情:

 find . name ".settings" -exec "svn delete .settings" {} \;

但我总是得到“没有这样的文件或目录错误”

4

2 回答 2

1
find . -iname .settings -exec svn delete {} \;

编辑:find为了您对命令用法的更多了解:

sgeorge-mn:stack sgeorge$ mkdir .settings
sgeorge-mn:stack sgeorge$ mkdir -p dir1/.settings
sgeorge-mn:stack sgeorge$ mkdir -p dir2/.settings
sgeorge-mn:stack sgeorge$ mkdir -p dir2/dir2_1/.settings

sgeorge-mn:stack sgeorge$ find . -type d -iname .settings
./.settings
./dir1/.settings
./dir2/.settings
./dir2/dir2_1/.settings

sgeorge-mn:stack sgeorge$ find . -type d -iname .settings -exec ls -ld {} \;
drwxr-xr-x  2 sgeorge  wheel  68 Jan 18 21:59 ./.settings
drwxr-xr-x  2 sgeorge  wheel  68 Jan 18 21:59 ./dir1/.settings
drwxr-xr-x  2 sgeorge  wheel  68 Jan 18 21:59 ./dir2/.settings
drwxr-xr-x  2 sgeorge  wheel  68 Jan 18 21:59 ./dir2/dir2_1/.settings
于 2013-01-18T16:27:06.087 回答
0

您可以安装TortoiseSVN,将您的存储库签出到一个文件夹,然后轻松识别并恢复您的更改。

于 2013-01-18T16:29:31.963 回答