kaybenleroll
kaybenleroll

Reputation: 17022

Changing the Directory Structure in Subversion

How do I create a branch in subversion that is deeper' than just the 'branches' directory?

I have the standard trunk, tags and branches structure and I want to create a branch that is several directories deeper than the 'branches' tag.

Using the standard svn move method, it gives me a folder not found error. I also tried copying it into the branches folder, checked it out, and the 'svn move' it into the tree structure I wanted, but also got a 'working copy admin area is missing' error.

What do I need to do to create this?

For the sake of illustration, let us suppose I want to create a branch to go directly into 'branches/version_1/project/subproject' (which does not exist yet)?

Upvotes: 6

Views: 2735

Answers (5)

xanadont
xanadont

Reputation: 7614

If you're using TortoiseSVN, you can use its Repository Explorer to do such things. Makes it all pretty WYSIWYG simple.

Upvotes: 1

warsze
warsze

Reputation: 443

SVN doesn't really manage your branches. It simply does a wholesale copy. It's up to you how you want to manage it.

Upvotes: 1

Kit Roed
Kit Roed

Reputation: 5217

I second the use of TortoiseSVN, simply right-click on the directory and go to TortoiseSVN->Branch/tag... to quickly create a branch at a specified directory. Be sure to fill out the URL to be what you want it to be on the resulting "Copy (Branch / Tag)" dialog window.

Upvotes: 2

zigdon
zigdon

Reputation: 15073

Since subversion doesn't actually think of branches as anything special other than more directories, you can always just create the directory tree you want (with svn mkdir) then copy the code you want into the tree location.

Or just use the --parents flag @BlairC mentioned.

Upvotes: 3

Blair Conrad
Blair Conrad

Reputation: 242090

svn copy --parents http://url/to/subproject http://url/to/repository/branches/version_1/project/subproject

That should create the directory you want to put the subproject in (--parents means "create the intermediate directories for me").

Upvotes: 14

Related Questions