TortoiseSVN 只取下或更新部分文件的方法(Sparse Update/Sparse Checkout)

Sparse Update/Sparse Checkout   To easily select only the items you want for the checkout and force the resulting working copy to keep only those items, click the Choose items... button. This opens a new dialog where you can check all items you want in your working copy and uncheck all the items you don't want. The resulting working copy is then known as a sparse checkout. An update of such a working copy will not fetch the missing files and folders but only update what you already have in your working copy.

If you check out a sparse working copy (i.e., by choosing something other than fully recursive for the checkout depth), you can easily add or remove sub-folders later using one of the following methods.

4.3.1.1. Sparse Update using Update to Revision Right click on the checked out folder, then use TortoiseSVN → Update to Revision and select Choose items.... This opens the same dialog that was available in the original checkout and allows you to select or deselect items to include in the checkout. This method is very flexible but can be slow as every item in the folder is updated individually.

4.3.1.2. Sparse Update using Repo Browser Right click on the checked out folder, then use TortoiseSVN → Repo-Browser to bring up the repository browser. Find the sub-folder you would like to add to your working copy, then use Context Menu → Update item to revision....

4.3.1.3. Sparse Update using Check for Modifications In the check for modifications dialog, first shift click on the button Check repository. The dialog will show all the files and folders which are in the repository but which you have not checked out as remotely added. Right click on the folder(s) you would like to add to your working copy, then use Context menu → Update.

This feature is very useful when you only want to checkout parts of a large tree, but you want the convenience of updating a single working copy. Suppose you have a large tree which has sub-folders Project01 to Project99, and you only want to checkout Project03, Project25 and Project76/SubProj. Use these steps:

Checkout the parent folder with depth “Only this item” You now have an empty top level folder.

Select the new folder and use TortoiseSVN → Repo browser to display the repository content.

Right click on Project03 and Context menu → Update item to revision.... Keep the default settings and click on OK. You now have that folder fully populated.

Repeat the same process for Project25.

Navigate to Project76/SubProj and do the same. This time note that the Project76 folder has no content except for SubProj, which itself is fully populated. Subversion has created the intermediate folders for you without populating them.

上一篇:Adele的生活


下一篇:Oracle分页查询SQL实现