Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 483381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:11:30+00:00 2026-05-13T01:11:30+00:00

I’m new to SVN so this could be an easy question. We have a

  • 0

I’m new to SVN so this could be an easy question.

We have a “trunk” with 1st level directories:

10 <-- documents
20 <-- source code, db scripts, ...
30 <-- documents
40 <-- referenced 3rd party library-es

I made a “develop” branch from the “trunk”.
In “develop” we change our source code and after testing it we merge it to “trunk”.

The problem in that in directories “10” and “30” are stored *.doc files that are not needed for development so it is REQUIRED that “develop” branch doesn’t have those directories.

The solution should still:

  1. allow “svn update” on root folder of “develop” working copy, (20 and 40)
  2. that update should not re-create
    directories 10 and 30 and
  3. of course merging “develop” to “trunk” should NOT delete 10 or 30 in “trunk”.

EDIT:
I forgot to mention that “source code” is not only in 20. There are referenced dll-s and build scripts etc. that are also on 1st level directory, lets say 40.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T01:11:30+00:00Added an answer on May 13, 2026 at 1:11 am

    If I read your question correctly, this is a simple matter of using svn copy to copy only the desired directories into a branch — basically, a combination of answers from Mike Kushner and Ivan Krechetov. I think, however, it might be easier to understand after running through the steps yourself, so the rest of this post will create a sample repository and show the copies and merges.

    I’m going to assume that you’re using the “standard” repository layout, which at the top level has three sub-directories, trunk, branches, and tags. And that your 10, 20, 30, and 40 directories are under trunk. In other words:

    trunk
        10
        20
        30
        40
    branches
    tags
    

    And, as Mike pointed out, your goal will be to have a structure that looks like this:

    trunk
        10
        20
        30
        40
    branches
        sandbox
            20
            40
    tags
    

    It’s unclear from your posting (at least as-of the current edit), but you may have a directory structure in which 10, 20, et al are at the top level. In this case, you’ll need to create a new top-level directory, which I’ll call dev, so that your overall repository looks like the following:

    10
    20
    30
    40
    dev
        20
        40
    

    Note that you cannot create dev under 20. Well, physically you can, but you’re almost guaranteed to break your build when doing so.

    OK, so let’s walk through an example, in which we create a new repository and put some files in it. You have to be able to run the svnadmin command (which you should be able to do, unless you have a paranoid sysadmin). So pick a temporary directory, and execute the following commands (I’m running Linux; if you’re running Windows the commands will be the same, but you’ll need to put a Windows-specific path in the REPO variable):

    svnadmin create temp.repo
    REPO="file://`pwd`/temp.repo"
    svn co $REPO temp
    

    This creates a new (empty) repository, and checks out a working copy of it. The second line needs some explanation: it simply creates the repository URL from the current directory. In my workspace directory, the URL looks like this:

    file:///home/kgregory/Workspace/temp.repo
    

    OK, now that you’ve got a working copy, let’s create the sample directory structure and some files:

    cd temp
    svn mkdir trunk
    svn mkdir branches
    svn mkdir tags
    svn commit -m "standard repo structure"
    
    pushd trunk
    svn mkdir 10
    svn mkdir 20
    svn mkdir 30
    svn mkdir 40
    svn commit -m "example sub-project structure"
    
    echo "this doesn't change" > 10/dontchange.txt
    svn add 10/dontchange.txt
    echo "this does change" > 20/change.txt
    svn add 20/change.txt
    svn status
    svn commit -m "example files"
    popd
    

    At this point we have the sample directories and two files in them. Here’s the output from find, excluding subversion’s hidden directories:

    temp, 531> find . | grep -v svn
    .
    ./tags
    ./trunk
    ./trunk/10
    ./trunk/10/dontchange.txt
    ./trunk/30
    ./trunk/20
    ./trunk/20/change.txt
    ./trunk/40
    ./branches
    

    Next step is to create the sandbox directory, and make copies of the two directories that are going to be in it:

    svn mkdir branches/sandbox
    pushd branches/sandbox
    svn copy ${REPO}/trunk/20 .
    svn copy ${REPO}/trunk/40 .
    svn commit -m "make development branch"
    popd
    

    This is the important part: I creating the branch and copies in my working directory, as a copy from the repository. Normally, you just copy trunk into a child of branches, using svn copy with two repository arguments. That doesn’t work here, because we want only two children of trunk.

    After doing this, my working copy looks like this:

    temp, 539> find . | grep -v svn
    .
    ./tags
    ./trunk
    ./trunk/10
    ./trunk/10/dontchange.txt
    ./trunk/30
    ./trunk/20
    ./trunk/20/change.txt
    ./trunk/40
    ./branches
    ./branches/sandbox
    ./branches/sandbox/20
    ./branches/sandbox/20/change.txt
    ./branches/sandbox/40
    

    At this point, you’d normally check out the development branch into a new working directory and work there. So I’ll do that (after a cd back to my Workspace directory):

    svn co ${REPO}/branches/sandbox sandbox
    cd sandbox
    

    And now make some changes:

    vi 20/change.txt
    svn commit -m "changed on branch"
    

    OK, now it’s time to merge back to the trunk. So go back to the workspace, and check out just the trunk:

    svn co ${REPO}/trunk trunk
    cd trunk
    

    And merge from the sandbox. The merge process is described in the Subversion docs:

    svn merge -r 4:5 ${REPO}/branches/sandbox
    svn status
    

    That last command should show you that only the file 20/change.txt was affected by the merge. Since you didn’t copy the 10 or 30 directories into the branch, they won’t be touched by the merge.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This could be a duplicate question, but I have no idea what search terms
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I have a reasonable size flat file database of text documents mostly saved in
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.