Subversion 中所有版本化文件的列表? (按名称删除文件)
办公室里的一些聪明人设法将一大堆“备份”文件(它们以 ._
开头)提交到我们的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果它仅在一次提交(或一系列提交)中,则使用 svn merge 来撤消它。
如果用户已经在多次提交中执行此操作并且您在 Linux 上:
首先检查是否正确列出了您要删除的文件:
然后实际调用 svn 来删除它们:
检查 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:
Then actually invoke svn to delete them:
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.
关键是要观察目录是否以斜杠结尾。
然后您可以使用 grep。
The key is to observe the directories will end with a slash.
You can then use grep.
递归列出所有文件和目录
lists all files and directory recursively