SVN 使用通配符删除?
我正在将 VSS 存储库迁移到 SVN,并在第一次签入时无意中包含了所有 _vti_cnf、*.scc 文件。我想从 SVN 中删除这些。 (当然不是永久的——只是在头脑中)。相关应用程序非常大,逐个文件夹查找和删除这些文件将花费很长时间。
建议?一定有一些明显的方法可以做到这一点,但是临近周末正在干扰我的高级大脑功能。
I'm migrating a VSS repository to SVN and inadvertently included all of the _vti_cnf, *.scc files in the first check-in. I'd like to remove these from SVN. (Not permanently, of course - just in the HEAD). The application in question is quite large, and finding and deleting these files on a folder-by-folder basis will take forever.
Suggestions? There must be some obvious way to do this, but the proximity of the weekend is interfering with my higher brain functions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
乔纳斯的回答应该没问题。也许您遇到冲突是因为您在文件系统级别删除它们,绕过了 Subversion 的控制?
以下内容对我有用(=我在上下文菜单中获得必要的命令):
完成!
提供版本控制建议时通常的免责声明,小心,有备份,我不承担任何责任等等。
Jonas' answer should woirk fine. Maybe you are getting conflicts because you're deleting them on file system level, bypassing Subversion's control?
If you can use TortoiseSVN, the following works for me (=I get the necessary commands in the context menu):
Done!
Usual disclaimer when giving version control advice, be careful, have backups, I'm not taking any responsibility etc. etc.
在 Windows 命令提示符中,您可以使用“for”执行递归文件搜索,并为每个匹配的文件调用“svn delete”,
注意:请记住,在批处理文件中,您需要将 %i 替换为 %%i。
要了解可以与“for”(它是搜索和解析的瑞士军刀)一起使用的所有其他标志,请使用 help 命令,
In a windows command prompt you can perform a recursive file search with 'for' and invoke 'svn delete' for each matching file,
NB: Remember that in a batch file you'll need to replace %i with %%i.
To find out about all the other flags you can use with 'for' (it's the swiss army knife of searching and parsing) use the help command,
如果您运行的是 Linux 或 Mac OS,您可以使用
find
,就像我不再是 SVN 用户(并且从未使用过 VSS)一样,因此您可能需要修改命令行和/或者先尝试使用
-print
。If you are running linux or Mac OS, you could go with
find
, likeI'm no more a SVN user (and never used VSS) though, so you may want to modify the command line and/or try with
-print
first.难道你不能只 grep (或其他一些查找文件的操作)签出版本中的 *.scc 文件,删除它们,然后提交吗?
Can't you just grep (or some other operation that finds files) the *.scc files in a checked out version, delete them, and then commit?
或者使用 PowerShell:
其中 *.txt 是通配符,* 指定在当前目录中查找要删除的文件
Or use PowerShell:
where *.txt is the wildcard and * specifies current directory where to look for the files to be deleted