1

I am working on Windows 7. I have deleted a branch, b4, and then created a new branch with the same name on the repository. Now I am trying to check out the newly created branch, b4, which has the same name as before.

project    
    -branches
      -b1
      -b2
      -b3    
    -trunk

If I issue svn command under project directory like this:

svn co http://XXXX/project/branches/b4 branches

I will get svn: E155000: 'D:\1-workspace\project\branches' is already a working copy for a different URL error.

I have also tried with TortoiseSVN but I got the same error as command line.

if I issue svn command like this:

svn co http://XXXX/project/branches/b4 branches\b4

I can checkout the code but there is a .svn folder under the b4 folder. I don't think it is what I want. There is already a .svn folder under the project folder. This extra folder may cause other problems.

I have looked at similar older answers here and here, but none works in my case.

peterboston
  • 877
  • 1
  • 12
  • 24

1 Answers1

1

I suggest you to use TortoiseSVN that has a smart feature to update only the sub-folders you want to update:

  1. Right-click on branches folder in your local working copy
  2. Select TortoiseSVN => Update to revision...
  3. Check the radio button "HEAD revision" to update to HEAD
  4. Under "Update Depth", select "Only this item"
  5. Click on "Choose items..." and select the branches you need: b1, b2, b3 and b4.
    Be very careful here because if you select only b4, TortoiseSVN will delete the branches b1, b2 and b3 from your working copy ! Note also that it will update b1, b2 and b3 to HEAD revision.
  6. Check the box "Make depth sticky" only if you want to always update branches in this way.
  7. Click on OK and enjoy !
Laurent H.
  • 6,316
  • 1
  • 18
  • 40
  • You are my hero. it works!!! It is really wonderful to know the TortoiseSVN has such smart feature. You are the best! – peterboston May 30 '18 at 15:53
  • I have similar issue again. A coworker has created a 'products' folder in the same level as branches and trunk, and put a released code there under a folder 'tianshui'. I use the same steps trying to get the new 'products/tianshui' but I cannot. The error says: None of the targets are working copies. The difference is that this time is really a new folder. Last time the b4 folder was there before. It was deleted and then added back again. – peterboston Jun 15 '18 at 03:52
  • In your local working copy, do you have the "project" folder linked to the repository ? It seems not. In this case you have to perform a checkout of the "products" folder at the same level as branches and trunk. – Laurent H. Jun 15 '18 at 06:34
  • yes, I do. Under the project folder there is a '.svn' folder and also 'branches', 'trunk' folders, and the new 'products' folder. – peterboston Jun 15 '18 at 12:45
  • Good news! it works now. the new code is under the new products/tianshui. there are two folders. I should only include the folder one by one, i.e. add the 'products' folder first. and then repeat the process to add the 'tianshui' folder. – peterboston Jun 15 '18 at 14:24