A repository is the central database shared by all members of a project. It contains the complete history of all files in the project.
A repository is structured much like the file system on a Mac or PC containing a hierarchy of nested files and folders.
Repositories should always be located on the local disk of the server which is accessing it. Never attempt to share a repository between computers by placing it in a shared location on the network.
A Subversion server is exclusively concerned with managing access to the files in a repository.
Subversion servers basically come in two flavors: those based on the
Apache web server and those using the custom svnserve
server.
Subversion clients (such as Cornerstone) generally access a repository by communicating with a server. The format of this communication is termed the protocol.
Subversion supports a number of different protocols which suit a variety of needs: HTTP and HTTPS are best suited to access repositories available via public networks such as the Internet, while the custom SVN protocol is generally used to access repositories on a private network.
Some servers might provide access via multiple protocols, e.g. many open source projects provide HTTP for anonymous, read-only access and HTTPS for write access limited to project members.
The scheme component of the URL (e.g. http://
) is used to describe the protocol used to communicate with the server, with http://
, https://
and svn://
used to access the three protocols mentioned above.
A fourth scheme, svn+ssh://
specifies that the svn://
protocol should be tunneled through the secure shell tool SSH adding an industry-standard authentication and encryption layer, thus making the svn://
protocol suitable for use over public networks. The configuration of SSH tunneling with Subversion is a relatively involved process and is not covered in further detail in this document.
A URL uniquely describes the location of a resource on the Internet. In a similar fashion, Subversion uses URLs to identify items in a repository, with the URL at once identifying the server, repository and path of the file or folder in question.
For example:
http://svn.example.com/repos/project/file.txt
might identify file.txt
located in the project folder of the repos repository served by the server at http://svn.example.com
. Not all repositories will follow this scheme (for example the repos
component may not be present) but most URLs will look similar.
You can directly access a repository on your Mac without requiring a server (and by extension, a communication protocol). However, you are still required to use a URL to identify files and folders. For example, you would use the following URL to identify file.txt
in the project
folder of the repository located at /Users/zoe/Repository
:
file:///Users/zoe/Repository/project/file.txt
Note the use of the third forward slash after file://
. This identifies the root of the file system on your Mac. Think of this as the conjunction of file://
and the path /Users/zoe/Repository/project/file.txt
.
Remember that file.txt
isn’t actually located at this path. Instead, Subversion uses it to virtually identify the file in the repository.