In my first multi-part tutorial I will give an in-depth primer on how to use Subversion (SVN). Subversion is one of the mostly widely used version control systems in the software development industry. Subversion is based off of CVS and while I haven't personally used CVS I'd imagine the vast majority of what is in this primer can be transferred over fairly easily to CVS. So this primer should effectively prepare you for any version control system you will likely encounter. There are a couple other version control systems out there, but these are the two major players.
The primer will be broken down into three parts; part one will focus on setting up a SVN server, installing the SVN clients and creating a new project. Part two will go over most of the day to day functions of using SVN. In part three I will go over a few more day to day SVN functions as well as go into a few advanced subjects like setting up properties, which can be very useful. This primer will be used as platform for some exciting future projects I will be doing on this site. If you do not yet know how to use SVN I would suggest reading up on this primer as it will be quite useful both for this site and your career.
Setting up the server
A natural starting point for this primer would be to get a SVN server setup on your system. While there are several options out there, the one I am most familiar with is VisualSVN. Click on the link and download VisualSVN. Once the file has finished downloading follow these steps:
1. Select install VisualSVN and management console
2. Uncheck use secure connection, port can be set to whatever you want, but I will be using the default in my primer (443), same goes for the repository location.
Once the installation is complete the management console should automatically start. We now need to configure the SVN server:
1. Select create a new repository
2. Give your repository a name, I gave mine SVNTest, leave “Create default structure” unchecked
3. Next create a new user, my user name is ninjaneer with the username as the password.
4. On the left hand side of the screen, expand repositories, right click on SVNTest and create a new project called “SVNProject”
In order to effectively use SVN we will need to use a client. I will be actually covering two SVN clients; TortoiseSVN and Subclipse.
Go here to download TortiseSVN. Choose either the 32-bit or 64-bit flavor. This is a very standard install, just accept all the defaults and hit install.
Installing Subclipse is a little different as it is an Eclipse plugin, but luckily Eclipse has a sweet plugin installer to handle most of this for us. (If you haven't used it before here is a tutorial on how to use Eclipse's built in plugin install feature.) Here is the download site for subclipse: http://subclipse.tigris.org/update_1.6.x. Select “Core SVNKit Library” and “Subclipse” and continue with the plugin install.
Adding a project to SVN
In Eclipse we are going to create a new project. I will name the project “SVNProject” and I will accept the defaults. To upload a project to a SVN repository right click on the project folder>Team>Share Project>SVN. You will need to enter the url of your SVN repository; open up the VisualSVN management console and look for “Server URL is: http://xxxxx:443/svn/.” Copy the url and paste it into the dialogue box in Eclipse. BEFORE YOU CLICK NEXT, type in the repository name, in this example it is SVNTest, so your repository url should look similar to this http://xxxxx:443/svn/SVNTest. On the next page select “use specified folder name” then click the select button, select SVNProject>trunk. For organizational purposes it is best to give each project in the repository its own; trunk, branch, tag hierarchy, otherwise it can become very difficult to manage multiple projects.
This will conclude the first part of the SVN primer. In part two I will go over more of the day to day tasks of using SVN; checking out a project, committing, updating, resolving conflicts, synchronizing, branching, tagging, and reverting as well as some come terms. Check back later this week for part two. If you have any questions or comments please let me know.
Part two has been posted, check it out