开发者

SVN Checkout a single directory

开发者 https://www.devze.com 2023-04-01 08:44 出处:网络
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.

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开发者_如何学C 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号