Creating a new repository

Create a new repository

svnadmin create /path/to/repos

Choose a repository layout

From Adding Projects - Chapter 5. Repository Administration - Version Control with Subversion:

You can either keep all projects in a single repository, in which case you'll be able There are benefits to using a single repository for multiple projects, most obviously the lack of duplicated maintenance. A single repository means that there is one set of hook scripts, one thing to routinely backup, one thing to dump and load if Subversion releases an incompatible new version, and so on. Also, you can move data between projects easily, and without losing any historical versioning information.

The downside of using a single repository is that different projects may have different commit mailing lists or different authentication and authorization requirements. Also, remember that Subversion uses repository-global revision numbers. Some folks don't like the fact that even though no changes have been made to their project lately, the youngest revision number for the repository keeps climbing because other projects are actively adding new revisions.

A middle-ground approach can be taken, too. For example, projects can be grouped by how well they relate to each other. You might have a few repositories with a handful of projects in each repository. That way, projects that are likely to want to share data can do so easily, and as new revisions are added to the repository, at least the developers know that those new revisions are at least remotely related to everyone who uses that repository.

I normally choose the middle ground approach. For example I'll have one repository for my software development that includes tests, code and documentation, one project for my website that includes markup, styling and documentation, one for technical documentation, etc etc.

Import choices

You can import any existing files into your repository. If you want to start with a clean slate, create a directory structure and import that into the repository. Alternatively, if you already have files that you want to version, you can import those into the repository, in which case skip the next step.

Create the directory structure

Create the directories in a temporary directory.

mkdir /directory/to/import
cd /directory/to/import
mkdir projectA
mkdir projectA/trunk
mkdir projectA/branches
mkdir projectA/tags
mkdir projectB
mkdir projectB/trunk
mkdir projectB/branches
mkdir projectB/tags

Import the files into subversion

This will import the contents of /directory/to/import into the repository at /path/to/repos.

svn import /directory/to/import file:///path/to/repos --message "Initial import"

If you created a temporary directory as per the previous step, you can now remove it.

Checkout the repository to make a working copy

This will checkout the contents of the repository at /path/to/repos to you working copy directory at /path/to/working/copy.

svn co file:///path/to/repos /path/to/working/copy

What's next?

You've now got your working copy. Work on it, using subversion as usual. If you need more information, please refer to the Version Control with Subversion manual.


Last modified: 30/11/2006 (most likely earlier as a site migration in 2006 reset some dates) Tags: (none)

This website is a personal resource. Nothing here is guaranteed correct or complete, so use at your own risk and try not to delete the Internet. -Stephan

Site Info

Privacy policy

Go to top