2.2. Creating a Repository

Subversion keeps its information about your code in a database called a repository. To create one of those, find a nice, out-of the way spot on a hard drive somewhere. Ideally, this spot is on a remote server accessible over the network. The next-best case would be to store the repository on a remote hard drive. If neither option is available, then you can set up the repository on the same drive as your Rails project. In a team project, it's important that all team members have access to the repository.

Wherever you put the repository, the first step is to tell Subversion to create the repository with the svnadmin create command. Let's say that you've decided to put the Subversion repository on your local system at /usr/local/subversion. In that case, you can create your repository by entering the following commands:

$ cd /usr/local/subversion
$ svnadmin create ./soupsonline

Just to clarify, the command-line examples in this book should work under most flavors of Linux and under Mac OS X. Windows users will need to either use a Unix shell emulator like Cygwin or just flip the slashes around in the pathnames.

There won't be any text response in the command shell, but Subversion will have created the necessary files to manage an empty code repository in the directory /usr/local/subversion/soupsonline.

By convention, you need to set up three top-level subdirectories — trunk, tags, and branches — for each Subversion project. The trunk directory is for the ...

Get Professional Ruby on Rails™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.