0. FAQ First
Q: I heard that Subversion is an Apache extension? Does this mean I have to set up Apache to use Subversion?
A: The short answer: no. The long answer: if you just want to access a repository, then you only need to build a Subversion client. If you want to host a networked repository, then you need to set up either Apache2 or an “svnserve” server.
for more faq: http://subversion.tigris.org/faq.html
- Open the windows explorer
- Create a new folder and name it e.g.
- Right-click on the newly created folder and select TortoiseSVN → Create Repository here….
A repository is then created inside the new folder. Don’t edit those files yourself!!!. If you get any errors make sure that the folder is empty and not write protected.
2. Local Access to the Repository
To access your local repository you need the path to that folder. Just remember that Subversion expects all repository paths in the form
file:///C:/SVNRepository/. Note the use of forward slashes throughout.
To access a repository located on a network share you can either use drive mapping, or you can use the UNC path. For UNC paths, the form is
file://ServerName/path/to/repos/. Note that there are only 2 leading slashes here.
3. Repository Layout
Before you import your data into the repository you should first think about how you want to organize your data. If you use one of the recommended layouts you will later have it much easier.
There are some standard, recommended ways to organize a repository. Most people create a
trunkdirectory to hold the “main line” of development, a
branchesdirectory to contain branch copies, and a
tagsdirectory to contain tag copies. If a repository holds only one project, then often people create these top-level directories:
If a repository contains multiple projects, people often index their layout by branch:
…or by project:
Indexing by project makes sense if the projects are not closely related and each one is checked out individually. For related projects where you may want to check out all projects in one go, or where the projects are all tied together in a single distribution package, it is often better to index by branch. This way you have only one trunk to checkout, and the relationships between the sub-projects is more easily visible.
So if you haven’t already created a basic folder structure inside your repository you should do that now:
create a new empty folder on your hard drive (NOT INSIDE THE Already created repository –
create your desired top-level folder structure inside that folder – don’t put any files in it yet!
import this structure into the repository via a right click on the folder and selecting TortoiseSVN → Import… This will import your temp folder into the repository root to create the basic repository layout.
Note that the name of the folder you are importing does not appear in the repository, only its contents. For example, create the following folder structure:C:\Temp\New\trunk C:\Temp\New\branches C:\Temp\New\tags
C:\Temp\Newinto the repository root, which will then look like this:/trunk /branches /tags
You can also use the repository browser to create new folders directly in the repository.
4. Import Content
Before you import your project into a repository you should:
Remove all files which are not needed to build the project (temporary files, files which are generated by a compiler e.g. *.obj, compiled binaries, …)
Organize the files in folders and subfolders. Although it is possible to rename/move files later it is highly recommended to get your project’s structure straight before importing!
Now select the top-level folder of your project directory structure in the windows explorer and right click to open the context menu. Select the command TortoiseSVN → Import which brings up a dialog box for you to enter the URL of the repository into which you want to import your project.
As soon as you press OK TortoiseSVN imports the complete directory tree including all files into the repository. As before, the name of the folder you import does not appear in the repository, only the folder contents. The project is now stored in the repository under version control. Please note that the folder you imported is NOT under version control! To get a version-controlled working copy you need to do a Checkout of the version you just imported.
For more information, take a look at the TortoiseSVN Help Context Menu.