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/
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.



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.

  • 1
    +1 for mentioning the SVN book. – David Pashley Jul 30 '09 at 14:58

"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"

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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