简体   繁体   中英

How do I make a subdirectory inside an svn repo an svn repo?

I have checked out an svn repository with the structure:

/.svn
/trunk
/branches
/tags

How can I make the trunk folder the root of the repository and get rid of the rest, so that trunk becomes the new root with its own .svn folder? I'd like to do this without communicating with the remote.

Also I would like to know if it's possible to do the inverse of that - having downloaded an svn repo folder by folder, each folder is now a separate repo, I'd like to combine all the folders into a single repo.

It seems that you mixed up two things: changing the repository layout and checking out only a part of a repository. The later one will give you a directory with the content of the trunk folder and the hidden .svn folder. To do so you just add /trunk to your URL during the checkout, eg svn checkout <OldUrl>/trunk <LocalPath> or shorthand from svn co <OldUrl>/trunk <LocalPath>

You can change the repository layout easily after checking out the whole repository. Just rearrange your folder as you like (using SVN commands --> Tree changes) and then commit your changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM