Tortoise SVN:如何svn更新文件夹但不更新其子文件夹?
这可能有一个简单的解决方案,但我可能根本不擅长使用 Tortoise SVN。
我前段时间检查过这个工作目录:
/folder
file1
file2
/subfolder1
/subfolder2
现在我想做的就是 SVN 更新我的工作目录,仅针对 /folder
中的文件,而不是其子文件夹。我该怎么做?
请注意,在 SVN 服务器存储库上,/folder
现在包含我想要的新文件 file3
、file4
在 SVN UPDATE 后在工作目录中查看。
编辑因为可能还不清楚:在 SVN UPDATE 期间 SVN 不得触及子文件夹,我根本不希望它触及它们。我尝试使用Greg答案,但它不起作用,并且警告:子文件夹1和子文件夹2将在更新期间从您的工作副本中删除。
谢谢。
This is probably something that has got a simple solution, but I'm probably not good at all in using Tortoise SVN.
I have this working direcetory that I checked out some time ago:
/folder
file1
file2
/subfolder1
/subfolder2
Now all I want to do is to SVN UPDATE my working directory only for the files in /folder
, but NOT its subfolders. How do I do this?
Be aware that on the SVN server repository, /folder
now contains new files file3
, file4
that I want to see in the working directory after the SVN UPDATE.
EDIT since maybe it's not clear: subfolders MUST not be touched by SVN during SVN UPDATE, I don't want it to touch them at all. I tried to use Greg answer but it does not work and WARNING: subfolder1 and subfolder2 will get DELETED from your working copy during the update.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用以下命令以非递归方式更新 SVN:
--深度
参数可以采用以下参数:empty
、files
、< code>immediates 或infinity
要使用 GUI 而不是命令行执行此操作,您可以使用
Update to revisions
,可在此处找到:然后选择
Head
版本,您可以指定更新的递归方式:根据您的情况,选择
直接子项,包括文件夹
将是最合适的。You can make SVN update non-recursively by using this command:
The
--depth
argument can take the following parameters:empty
,files
,immediates
orinfinity
To do this using the GUI rather than command line, you can use
Update to revision
, which can be found here:and then chosing the
Head
revision, you can specify how recursive the update is:In your case, choosing
Immediate children, including folders
will be most appropriate.我通常通过“检查修改”对话框执行部分更新。我启动它,单击“检查存储库”以获取可用更新,然后右键单击我想要获取的确切项目。
I normally perform partial updates from the "Check for modifications" dialogue. I launch it, I click on "Check repository" to get available updates and then right click on the exact items I want to fetch.
使用 TortoiseSVN 的
Update to Revision
代替Update
。指定HEAD
作为要更新的版本(或您想要更新的任何版本),然后选中“仅更新顶级文件夹”复选框。如果您通过 TortoiseSVN 发出 SVN 命令或者您使用命令行 SVN 客户端,Greg 的解决方案可以正常工作。
Instead of
Update
, use TortoiseSVN'sUpdate to Revision
. SpecifyHEAD
as the revision to update to (or whatever revision you want to update to), and then check off the box that says "Only update the top folder."Greg's solution works fine if you issue an SVN command via TortoiseSVN or you're using a command line SVN client.