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 369341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:54:38+00:00 2026-05-12T13:54:38+00:00

Assume that you have a directory under subversion control, that contains some files and

  • 0

Assume that you have a directory under subversion control, that contains some files and tons of subdirectories, like that:

file1.txt
file2.txt
file3.txt
dir1/
dir2/
dir3/
dir4/
:
dirXX/

Now you need the files and some of the dirs, but not all of them. This can be done with SVN. Just make the checkout non-recursive:

svn checkout -N <URL>

This checks out only the first directory and the files inside. No subdirectories are included. Even if you go into the checkout directory and run a “svn up“, it will only update the files checked out previously, it will not add the directories. You can now selectively add the directories you need by explicitly updating those. E.g. if you need dir2 and dir4 only, you can go into the checkout directory and execute

svn up dir2
svn up dir4

If you run a generic “svn up” in the future, it will only update the files and those two directories, it will not add any of the other directories.

Now the problem: What if I decide at any later point that I don’t need dir2 any longer? How do I get rid of it? There seems no way of doing so, other than deleting the whole checkout and start over from scratch.

When you just delete dir2, the next “svn up” will bring it back, as “svn status” of course shows it as missing now (“!” in front of its name). Running a “svn remove” will remove it of course, but on next commit it will also remove it from the repository, which must not happen.

Even the new sparse directory (“shallow checkout”) feature of SVN 1.5 is of no use here:

Subversion 1.5’s implementation of
shallow checkouts is good but does not
support a couple of interesting
behaviors. First, you cannot
de-telescope a working copy item.
Running svn update –set-depth empty
in an infinite-depth working copy will
not have the effect of discarding
everything but the topmost
directory—it will simply error out.

– http://svnbook.red-bean.com/en/1.5/svn.advanced.sparsedirs.html

Is this complete impossible with SVN? Anyone ever came up with a clever work-a-round to that?

Just creating the checkout directory (without SVN) and then checking out the individual subdirectories from the repository directly as subdirectories to this directory will work for the directories: now every directory is a checkout of its own, can be updated and once not needed any longer, you can just delete it. However, how do I get the files then (e.g. file1.txt)? SVN does not allow to checkout individual files, you can only checkout whole directories.

  • 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-12T13:54:38+00:00Added an answer on May 12, 2026 at 1:54 pm

    What I’m trying to do cannot be done with Subversion 1.4 or Subversion 1.5; Period.
    No work around exists, that’s just the way it is.

    It can be done with Subversion 1.6, though.

    Unlike SVN 1.5, SVN 1.6 can reduce the depth on a directory

    svn up --set-depth exclude dir2
    

    is the solution. It sets the depth for dir2 to zero and it will immediately vanish from the checkout and no update will bring it back, unless you explicitly set the depth of this directory to a value again (or just do an update on it without depth option, since not giving any depth always means infinity, unless you use non-recursive, which means “files”).

    TIP:
    Actually SVN 1.6 cannot really reduce the depth the same way it can increase it. You can increase it from any level to any higher level. You can only reduce it to “exclude” (the lowest level of all). If you want to reduce from “infinity” (highest) to “files” (somewhere in the middle), you must first reduce it to “exclude” (causing the directory to vanish) and then increase it back again to “files”. This is a bit of a hack, but it works just nice.

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

Sidebar

Related Questions

Assume that we have N erlang nodes, running same application. I want to share
Assume that you have a running SQL Server Express instance named (local)\SQLEXPRESS. Its database
To illustrate, assume that I have two tables as follows: VehicleID Name 1 Chuck
I'm working on an assignment that is telling me to assume that I have
Let's assume I have a model called product. Let's assume that product has three
Assume I have an ASP.NET MVC app that's not doing anything too fancy (no
(code examples are python) Lets assume we have a list of percentages that add
I have a fair few files that have been extracted from a zip created
Connection.close() may throw SqlException , but I have always assumed that it is safe
Assume that the core project has a base entity and every plugin maybe extends

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.