Subversion 中所有版本化文件的列表? (按名称删除文件)

发布于 2024-09-17 01:19:34 字数 319 浏览 0 评论 0原文

办公室里的一些聪明人设法将一大堆“备份”文件(它们以 ._ 开头)提交到我们的 subversion 服务器。

我最好使用一些基本的 bash 脚本来删除这些文件,而不是手动浏览存储库。

有什么方法可以获取目录中所有 subversion 版本控制文件的列表,以便我可以进行一些基本的 grepping / svn 删除?

编辑:

“svn list”不是递归的,而且似乎还列出了目录,我需要像“查找”这样的行为。

第二次编辑:

好的,-R 标志可以使“svn list”递归...但是如何删除目录?

Some smart dude at the office managed to commit a whole bunch of 'backup' files (they start with ._) to our subversion server.

Preferably I would like to delete these files using some basic bash script instead of going through the repository manually.

Is there any way I can get a list of all subversion versioned files inside a directory so I can do some basic grepping / svn deletes?

edit:

'svn list' isn't recursive and also seems to list directories, I need the kind of behavior like 'find'.

second edit:

Ok, the -R flag can make 'svn list' recursive... but how do I strip out directories?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

孤千羽 2024-09-24 01:19:35

如果它仅在一次提交(或一系列提交)中,则使用 svn merge 来撤消它。

如果用户已经在多次提交中执行此操作并且您在 Linux 上:

首先检查是否正确列出了您要删除的文件:

find . -name '._*'

然后实际调用 svn 来删除它们:

find . -name '._*' -exec svn rm {} \;

检查 svn 状态,如果良好则提交。

免责声明:我还没有测试这些命令,所以要小心。

我认为这些是它自动生成的 Mac 备份文件。

If it's only in one commit (or series of commits) then use svn merge to undo it.

If the user has been doing it across several commits and you're on Linux:

First check that this properly lists the files you want to delete:

find . -name '._*'

Then actually invoke svn to delete them:

find . -name '._*' -exec svn rm {} \;

Check svn status, commit if good.

Disclaimer: I have not tested the commands so beware.

I think those are Mac backup files it makes automatically.

流年已逝 2024-09-24 01:19:35

如何删除目录?

关键是要观察目录是否以斜杠结尾。

然后您可以使用 grep。

svn list -R my_svn_dir | grep -v '/

how do I strip out directories?

The key is to observe the directories will end with a slash.

You can then use grep.

svn list -R my_svn_dir | grep -v '/

傲世九天 2024-09-24 01:19:34
svn list -R

递归列出所有文件和目录

svn list -R

lists all files and directory recursively

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文