Creating a new repository in Subversion

For no other reason than 'I can never remember', this entry is being created. Most of my projects are ongoing, and rarely do I find the need to create new repositories. So when the time comes to run svnadmin create, I often find myself pondering the correct logistics of the svn import commmand.

This entry will assume you have a working subversion on your server. If you are on Ensim and you do NOT have subversion working on your server, then look no further than this article I wrote.

Now, let's get going:

1 - Create the tree for the repository:

cd /tmp
mkdir myproject
cd myproject
mkdir trunk
mkdir branches
mkdir tags
cd trunk
cp -R /path/to/my/project ./
cd ../../

2 - Create the new repository which, for the purposes of this entry, we will call 'myproject'. I am using the same naming convention that I used when I set up subversion. The path to my repos is where my subversion repos are officially kept according the apache configs I set up in this article.

svnadmin create /home/virtual/domainname/home/svn/repos/myproject

3 - Import the repos:

svn import /tmp/myproject file:///home/virtual/domainname/home/svn/repos/myproject -m "initial import"

You should see the following zip by on your screen:

Adding /tmp/project/branches 
Adding /tmp/project/tags 
Adding /tmp/project/trunk 
Adding /tmp/project/trunk/.... your files here

Assuming it all went well, don't forget to modify your svn-auth-file and svn-access-file.