Though Subversion is a powerful version control system, it’s command-line based interface may not appeal to some users who used other version control systems like Visual Source Safe. And what if you want to remotely access your repository as well?
TortoiseSVN and Apache comes to your aid. TortoiseSVN is a powerful tool for Subversion, which helps you to issue most of the subversion commands from your windows explorer. Subversion has an inbuilt “svnserve” utility which helps you to expose your repository to remote users, but it’s highly recommended to use the flexible Apache Web Server for this purpose. Subversion comes with it’s own apache modules to expose your repository to remote users. However, in this article we will not focus on Apache. I’m planning to write about the apache integration in my next post. Please be patient :-)
In this article you will learn how to install Subversion and TortoiseSVN and use them to create a repository, import files into the repository and view the repository.
Step 1: Install Subversion
Download subversion windows installer for Apache 2.2.x. (Download the file called “svn-x.y.z-setup.exe” and run the installer. Installing should be a straight forward option.
You might see the following windows. They are self explanatory.
Now you should have subversion successfully installed in your machine. To verify that, open the command prompt and type “svn –version”. If you see something like below, pat your head, you have successfully installed subversion.
If you couldn’t see the above mentioned message, you might want to check your “Path” environment variable and add your subversion installation directory to the “Path”.
Step 2: Install TortoisSVN
Download TortoiseSVN from here.
That’s it. Now the installer setup might prompt you to restart your system to complete the installation process. Accept it.
Step 3: Create a Subversion Repository
Now, it’s time to create a subversion repository. Though it’s possible to use the subversion’s “svnadmin” command to create the repository, we will use TortoiseSVN to achieve that.
3a) First, choose a appropriate location to keep all your repositories. In my case it’s “F:\Subversion”. Let us call this folder as REPOSITORY_ROOT. Now, let us create an empty directory called “MyRepository” inside REPOSITORY_ROOT. It should look something like this:
3b) Now, right click inside the folder REPOSITORY_ROOT\MyRepository, and click “TortoiseSVN -> Create repository here” menu.
3c) TortoisSVN will now prompt you with a message box like this:
Leave the default option (Native file system), and click “OK”. You can see a bunch of files inside the “MyRepository” folder like this:
Great!! This is your subversion repository.
Step 4: Import files into your subversion repository
4a) Let us add some files inside our newly created subversion repository. Right click a folder of your choice and click “TortoiseSVN -> Import”
4b) Enter the appropriate repository path where you would like to import these files into. In my case it’s “file:///f:/subversion/myrepository/photos”.
4C) When you press “OK”, TortoiseSVN will import all the files/folders inside the folder which you selected for the import operation into the subversion repository.
4D) Press “OK”. Now we have finished importing the files into our new subversion repostiory. It’s now time to view the content of our repository.
Step 5: Viewing the content of your subversion repository
5a) TortoiseSVN provides a nice “Repository Browser” option to view the content of your subversion repository. Right anywhere in your explorer window/desktop and click “TortoiseSVN -> Repo-browser”.
5B) Enter the url of your subversion repository. In my case, it’s “file:///f:/subversion/myrepository” and click “OK”.
5C) That’s it, now TortoiseSVN will list down all the files inside your repository.
In this article, you learned to:
– install Subversion
– install TortoiseSVN
– create a new repository using TortoiseSVN
– import files into the subversion repository using TortoiseSVN
– view the content of the subversion repository using TortoiseSVN
I initially thought of even writing about installing, configuring apache/websvn in this article itself. But it already took me nearly 3 hours to finish writing this. So please bear with me. I’ll come with a Part II of this article where you will learn how to use apache/websvn along with subversion to make the interaction with your version control system a pleasure. See you again.
Added on August 2, 2008:
I have written an article named “Extending Subversion with Apache“. This article is about setting up Apache http server and configuring it to access subversion repositories. It also deals how to setup Authentication and Access control for your subversion repositories using Apache. Hope you find it useful.