Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am a novice when it comes to using SVN on a command line. Previously I had done everything through a client.

I have created a new repository on my server like this:

%svnadmin create myrepo

However when I examine it, the trunk branches and tags are missing.

%cd myrepo/
%ll
total 14
229 Jul 28 10:22 README.txt
512 Jul 28 10:22 conf
512 Jul 28 10:22 dav
512 Jul 28 10:22 db
  2 Jul 28 10:22 format
512 Jul 28 10:22 hooks
512 Jul 28 10:22 locks

Do I need to create these manually? If so, do I just 'mkdir trunk', I thought you are not supposed to do anything to the files inside of the repo manually.

Thanks.

share|improve this question

3 Answers 3

up vote 5 down vote accepted

Yes, you need to create those folders manually.

You can either create the folders, then use

svn import

to import an existing structure, or, you can create the folders, then use

svn add foldername

for each folder you create.

I'd take a read of the svn book to get a better understanding of svn.

share|improve this answer
1  
+1 for mentioning the SVN book. –  David Pashley Jul 30 '09 at 14:58
    
I check out the book def, thanks. –  Louis W Jul 30 '09 at 15:04

"svnadmin create" creates file structure for the subversion backend. You need to manipulate it through the svn command. A new SVN repository has no files in it and you need to add the trunk, branches and tags directories yourself. Try:

# svn mkdir file://./myrepo/trunk -m "Add trunk directory"
# svn list file://./myrepo

You should now see your directory.

A better method would be to checkout your repository and add the directories there:

# svn checkout file://./myrepo/ myrepo-checkout
# cd myrepo-checkout
# mkdir tags branches trunk
# svn add tags branches trunk
# svn commit -m "add initial directories"
share|improve this answer

Another approach: first create the default tree (branches, tags and trunk) in a temporal directory:

mkdir branches
mkdir tags
mkdir trunk
svn import myrepotemp file:///myrepo/ -m "Initial layout"

Anyway, you will not see this layout in the repo directory.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.