General Information
Subversion is a revision control system for software and website
development. After creating a subversion repository and importing
your project files, you can commit subsequent changes into the
repository along with short descriptions of your modifications.
This allows you to roll back your changes and recover previous
versions of your files, and even restore deleted files.
If you've used CVS, you'll find subversion very similar. The
commands are almost exactly the same, with the addition of a
better access model and fixes for several major shortcomings of CVS.
This document is specific to using subversion with a Telana
web hosting account. General familiarity with the linux shell is
required, for now - we're working on making a control panel interface
for creating and managing subversion respositories. Until then,
configuration needs to be done from the command line.
For more information on subversion, the entire text of the O'Reilly
book "Version Control with Subversion" is available online at
http://svnbook.red-bean.com/en/1.2/
Setting Up a Repository
Repositories must be a subdirectories of /svn. This allows you to
have multiple repositories. To create a repository, run the following
command, replacing <repos> with whatever you want to name
the repository:
$ svnadmin create /svn/<repos>
Authentication and Access Control
Authentication is controlled by /svn/svn_users, which is just a
regular htpasswd file. To add a new subversion user or change the
password of an existing user:
$ htpasswd /svn/svn_users <username>
New password: <password>
Once you have at least one user set up, you have to set up access
control for it. By default, nobody has access to any repositories.
The file /svn/svn_access can be used to make general or fine-grained
access control rules - you can give a user access to all your repositories,
or restrict it to a single directory tree.
To give user bob read/write access to all repositories, add
the following to /svn/svn_access:
[/]
bob = rw
For more advanced access control, see this page of the subversion manual. Scroll down past the server
configuration example - that was as close as I could link you :)
Accessing Your Repositories
There are two ways to access your subversion repositories with the
subversion command-line tools - locally, from inside your web hosting
account, or remotely over http. The commands are the same, except
for the URL argument. We'll use the "import" command for this example.
To import a project from inside your account, such as your website
files, run this command on the server:
$ svn import /www/yourdomain.com file:///svn/<repos>
To import files from another system, run this command on the system
where your files are located (assuming you have the subversion software
installed on that system):
$ svn import /path/to/project/files http://yourdomain.com/svn/<repos>
The main difference between these two methods is that running subversion
on the server bypasses the authentication and access control defined by
the svn_users and svn_access files.
In addition to the command-line tools, you can also access your
repositories through two web-based tools:
- WebSVN - a web-based interface to subversion. Just go to
http://yourdomain.com/websvn/ to access your repositories.
- Trac - a project management system with subversion integration.
See /svn/trac/README for details.
There are also various graphical subversion clients for Windows,
Linux, and MacOS X.
Performing an In-place Import
Running the "import" command doesn't automatically convert the files
you're importing into what subversion calls a "working copy". The
typical process is:
- Import your project files with "svn import"
- Check out your files to a new location with "svn checkout"
Sometimes it's desirable to convert your original project files into
a working copy, without having to move things around. To do this,
you want to avoid the import command entirely. First, you do an
"svn checkout" of a new, empty repository into your project files,
then run "svn add" to add your files into the repository. Here
are the commands:
$ svnadmin create /svn/website
$ cd /www/yourdomain.com
$ svn checkout file:///svn/website .
$ svn add *
$ svn commit -m "initial import"
Using Subversion
The day-to-day usage of subversion is beyond the scope of this
document - hopefully by this point you can create a repository
and import your files. Further usage information is best found
in the subversion
manual.
If you have any problems getting started with subversion, write
to support@telana.com. Good luck!
|