开发者

Tortoise SVN: how to svn update folder but NOT its subfolders?

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 t开发者_如何学Pythono 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.


You can make SVN update non-recursively by using this command:

svn update --depth=files

The --depth argument can take the following parameters: empty, files, immediates or infinity

To do this using the GUI rather than command line, you can use Update to revision, which can be found here:

Tortoise SVN: how to svn update folder but NOT its subfolders?

and then chosing the Head revision, you can specify how recursive the update is:

Tortoise SVN: how to svn update folder but NOT its subfolders?

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.


Instead of Update, use TortoiseSVN's Update to Revision. Specify HEAD 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜