Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subversion - Checkout a parent directory

In my repository, lets say I have this:

Animal
  Dog
     Beagle
     Hound
     ...

Lets say I checked out Dog to a working directory and I realized, whoops, I really wanted to checkout Animal.

I can delete my working copy, the Dog directory, and checkout Animal, but is there way I can do so without deleting and checking out again?

If my working copy of Dog has Animal as a parent folder and I checkout Animal without deleting Dog, I get something like "subversion failed to add directory versioned same name already exists".

I'm also using tortoise. Thanks.

like image 369
Steve Avatar asked Aug 30 '09 14:08

Steve


2 Answers

This is not possible directly.

The easiest way is to delete your working copy and do a new checkout of Animal.

If you have any changes in Dog that you'd like to keep, move Dog to a temporary location, checkout Animal and then copy Dog back into the Animal directory.

like image 188
Palmin Avatar answered Nov 16 '22 00:11

Palmin


You're looking for svn switch, which updates your working copy to reflect a new path. Modified files don't get touched, though. In TortoiseSVN, right click and select "Switch..." from the context menu.

The more common use case for svn switch is to switch between branches that are rooted from the same point, so that you can have different views of the same code. But you can switch between arbitrary paths in your repository.

like image 45
John Feminella Avatar answered Nov 15 '22 23:11

John Feminella