11

Here is my dilemma:

I want to checkout a single directory (let's call it A) from SVN, but be able to do and svn up A from the parent directory on the computer is checked out on.

i.g. I am on in ~/coolstuff I want do do a checkout of A and put it in ~/coolstuff and when I am in ~/coolstuff I want to issue svn up and have it update A.

Here is a trick to do this in a basic scenario: In SVN A's parent directory is Z. I do an SVN checkout of Z in ~/coolstuff. I then mv ~/coolstuff/Z/.svn to ~/coolstuff. Walla I can do a svn up and it works and it will pull down A inside of ~/coolstuff.

My scenario: I do the same thing above, except the problem is that Z not only has the child A, but it also has the child B. So a svn up in ~/coolstuff will pull down A and B. But I don't want B to be pulled down.

Here is the solution: I edit ~/coolstuff/.svn/entries and removed the reference to B. Now svn doesn't see B, only A.

The solution above still initial pulls down A when I do the first checkout, I don't want to do this. It also seems very hack-ish. Is there a better/cleaner way to do this, and hopefully not have to pull down "B" at all?

Zoe
  • 27,060
  • 21
  • 118
  • 148
MrD
  • 629
  • 1
  • 8
  • 22
  • 11
    Please work on writing better questions. "pulls down B when I do A over Z through X around Y without doing C" makes things very hard to read and follow. Use names that more accurately represent what you're doing, so people don't have to waste time trying to figure out all of your imaginary names and can instead concentrate on helping you solve your problem. Thanks. :) – Ken White Aug 31 '11 at 22:33

1 Answers1

13

I think this is what you want to do:

svn co --depth empty file://path/to/A-B/parent coolstuff
cd coolstuff
svn up A

Now you can do an svn up from within coolstuff to update A without pulling in B automatically.

xn.
  • 15,776
  • 2
  • 30
  • 34
  • This is exactly what I wanted. I tried using depth immediates, but that won't pull down "A" when you cd into coolstuff. Perfect thanks a billion! – MrD Sep 01 '11 at 16:40