No matter what protocol you use to access the repository, you must create at least one repository at a time. You can do this either with the Subversion command line client or with TortoiseSVN.
If you have not yet created a Subversion repository, do so now.
Create a repository
Creating a repository with the command line client
Create an empty folder named SVN (z.B. D:\SVN\ ) where all repositories are stored.
Create another folder MyNewRepository inside D:\SVN\ .
Start the command line (or DOS box), change to D:\SVN\ and enter the following:
Now you have created a new repository in D:\SVN\MyNewRepository.
Creating a repository with TortoiseSVN
Figure 3.1. The TortoiseSVN menu for unversioned folders
Open Windows Explorer
Create a new folder and name it SVNRepository, for example .
After right-clicking on the newly created folder, choose TortoiseSVN → Create repository here. .
Now create a repository in the new folder. Do not edit these files yourself! . If you get an error message, make sure the folder is empty and not read-only.
You will also be asked if you want to create a directory structure in the repository. Learn more about layout options in "Repository structure".
TortoiseSVN will mark the folder with a custom icon when it creates a repository. So you can recognize local repositories more easily. When you create a repository with the official command line client, this folder icon is not assigned.
In general, we do not recommend using file:// access, except for local testing purposes. Using a server is generally safer and more reliable, except maybe for single users.
Local access to the repository
To access the local repository you need the path to the repository folder. Note that Subversion requires all repository paths to be in the form file:///C:/SVNRepository/.
To access a repository on a network share, you can either mount the share as a drive or use the UNC path. UNC paths have the form file://ServerName/Path/to/ProjectArchive/ . Note that there are only 2 slashes before the server name here.
Before Subversion 1.2 had to specify UNC paths in the obscure format file:///\ServerName/path/to/repos. This format is still supported, but not recommended.
Repository on a network share
Although it is theoretically possible to create an FSFS repository on a network share and have multiple users access it via file:// protocol, we advise against this for several reasons urgently from these:
First, give each user direct write access to the repository, so that any user can accidentally delete or otherwise make the repository unusable.
Secondly, not all network file protocols support the locking and protection mechanisms that Subversion requires, so the repository may become corrupted. This doesn’t have to happen right away, but one day two users will access the repository at the same time. At worst, the corruption will go unnoticed for a while.
Third, the file permissions must be right. You might be able to muddle through on a Windows-only share, but SAMBA is particularly difficult to set up.
If one person installs a newer client and it upgrades the repository format, everyone else will not be able to access the repository until they also upgrade to the latest client version.
Access via file:// is intended for local single-user access only, especially for testing and debugging. If you want to share the repository, you should use really set up a proper server. This is not nearly as complicated as you might think. Read "Accessing the repository" for instructions on selecting and setting up a server.
Before you import data into the repository, you should think about how you want to organize your data. If you use one of the recommended structures, you will have a much easier time later on.
There are a few recommended standards for organizing the data within a repository. Most people create a trunk folder for "trunk development", a branches folder for the development branches, and a tags folder for tagging states. If a repository contains only a single project, the following structure is recommended:
Because this layout is so commonly used, TortoiseSVN suggests you create this structure when creating a new repository.
However, if a repository contains multiple projects, it is organized by branches within the structure:
. or by project:
Organizing by project makes sense if the projects are not closely related and each is edited separately. For related projects that you want to check out all in one go, or that are grouped together in a distribution, it is often better to organize by branches. This way you only need to check out the trunk and the relationships between subprojects are easier to see.
If you choose the /trunk /tags /branches structure, you only need to copy the whole trunk when you create branches or tags. In some ways, this is the most flexible approach.
For completely independent projects, it is better to create a single repository per project. When committing changes, the repository revision number is incremented, not the project revision number. For multiple independent projects sharing an archive, this can lead to confusion if z. B. one of the projects is not worked on at all, but others are worked on a lot. For example, TortoiseSVN and Subversion appear on the same server (tigris.org), but are completely independent projects (archives) with independent development and without confusion about version numbers.
Of course you can also ignore these recommendations. You are free to choose a layout that works best for you or your team. Also note that whatever choice you make, it is not fixed. You can always reorganize the layout later. Because branches and tags are common folders in Subversion, you can easily rename or move them as you like using TortoiseSVN.
Switching from one layout to another is just a sequence of server-side renames. If you don’t like the way things are organized in the repository, just juggle around with the directories.
If you have not yet created a folder structure in your repository, you should do so now. There are two possibilities for this. If you only want the simple /trunk /tags /branches structure, you can create it in three steps using the repository viewer. If you want a more deeply nested hierarchy, you should create it on the local disk first and then import it in one step like this:
Create an empty folder on your hard disk
Create the folder structure you want in this folder – don’t copy any files into it yet!
Import this structure by right-clicking on the top folder and selecting TortoiseSVN → Import. into the repository. In the import dialog enter the URL of the repository and confirm with OK. This will import your folder into the repository and create the desired folder structure there.
Note that the name of the folder you import will not appear in the repository, only its contents. Create z. B. the following folder structure:
Import C:\Temp\New into the root of the repository, which will look like this: