The SVN implementation ignores the specified directory when updating the local version library

Source: Internet
Author: User
Tags svn svn update
The SVN implementation ignores the specified directory when updating the local version library
Most of the time, your SVN repo (assuming project) is very large (this means including all tags and branches), but what you really need is only one or two (for example, trunk, and trunk's install directory, While the install directory and the trunk directory have such a live connection, you want to be the CO project at SVN Co and ignore the directories you don't want. Of course, you don't have to have the CO whole project, and the directory you want alone is OK. However, from the SCM point of view, you can not forcibly change the user's habits of use, do not rule out that some people like this operation, especially for those who like to use the command line.

Perhaps I say so, we do not have any concept, I give you an example, you should know this is a kind of situation:

As we all know, in a project SCM management, often requires developers to play tag in the way to release, tag exists in tags directory, tags directory often with trunk/branches directory peers, there is also a install directory, as follows:
project/| |   
| branches |   | --Branch1   
|   | --BRANCH2   
|   '--Branch3 |--   
Install   
| tags |   | --Tag1   
|   | --Tag2   
|   | --Tag3   
|   | --Tag4   
|   '--tag5   
'--trunk   
    '--src  

Tags directory Although is a copy of the label, but in the process of checkout, it will be for a complete code, so many people do not want to be in the local working copy to keep this tags directory. Unfortunately, the SVN Co command does not have an option to ignore this directory.

In fact, I also had this problem, and after I saw a lot of help, I finally found a way. Specifically as follows (discussed in two situations):
I. Local preservation has a complete working copy situation:
In other words, you've got the complete repos/directories checkout from SVN to the local (there's already a full copy of your server-side). At this point, you only need to run the following command to exclude tags and the branches directory in the SVN up list:
# SVN update--set-depth=exclude tags branches
d    tags
d    

Options can be followed by more than one directory, so that in your current working copy of the tags and branches directory successfully excluded, in your next update, you will not ignore these two directories, but also to ensure that your project is in version Control, so you don't have to go to the directory one at a time to get svn up.

Ii. a completely new ignore directory checkout operation:
If this is the case in Windows, it is very simple, you only need to use the Turtle client's "Choose Item" button.

But if it's on the command line, it's a little bit more complicated, just follow these steps:

1. First checkout the directory tree to the Local:
[ROOT]@[FCK_WITH_U]:[~/TEMP]->>SVN Co http://svn_test_url.com/test_dir my_checkout--depth immediates   
A    My_checkout/backup   
A    my_checkout/doc   
a    my_checkout/scripts   
a    my_checkout/src   
a    my_checkout/data   
A    My_checkout/tool   
Checked out revision 736189

2. Exclude the directory you do not want to co (for example, I would like to exclude backup, data, doc, SRC, tool five directories, just want to checkout scripts directory):
[Root]@[fck_with_u]:[~/temp]->>cd my_checkout/   
[root]@[fck_with_u]:[~/temp/my_checkout]->>ls   
backup  data  doc  Scripts  src  tool   
[root]@[fck_with_u]:[~/temp/my_checkout]- >>SVN up--set-depth=exclude backup data doc src tool   
d         backup   
d         data   
D         Doc   
D         src   
d         Tool  

3. Update the scripts directory you want:
[ROOT]@[FCK_WITH_U]:[~/TEMP/MY_CHECKOUT]->>SVN Update--set-depth Infinity scripts/
A Scripts/trunk
A Scripts/trunk/test
...........

"Reprint Address" http://scmbob.org/exclude-dirs-when-svn-up.html
(This article from the Internet, does not represent the search station (http://www.ylzx8.cn/) view and position)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.