Using Subversion With Visual Studio

There are a few source control options out there, other than TFS, that provide good source control if you are working in Visual Studio.  If you have an operation that doesn’t need or want to spend the money of TFS, Subversion (SVN) is a good alternative.  You can even sign up for free SVN at Unfuddle; they also have priced packages as well.  Using SVN with Visual Studio is actually quite easy using the plugin by AnkhSVN.  One of the nice features is that you can use this SVN plugin in conjunction with TFS.  The following shows how to set this up.

1.  Download and install AnkhSVN for your version of Visual Studio.

2.  Once AnkhSVN is installed, you must tell Visual Studio to use this as the source control system.  Navigate to Tools^Options.  You will see a screen like the one below.  Select the AnkhSVN source control option.

selecting_source_control_options 

3.  Now we can add our solution or project to SVN source control.  If you right click a solution or project in the Solution Explorer you will see SVN options like the image below.

add_sln_to_svn

In this case I was adding a solution, so select “Add Solution to Subversion”.  A window will appear like the image below.  This is where you select the SVN source control location.  Verify that all the other settings are as you want, such as Project Name or Local Folder (the location of the code you are adding).  Once everything is set, click OK and all the files will be uploaded to SVN.  Once the files are uploaded you will see a “+” sign next to everything.  Right click on the solution one more time and select “Commit Solution Changes”.  This should change the yellow “+” to a green check mark.  Your done.

add_sln_window

4.  Once everything is is checked in, you can go about modifying code again.  Anytime you modify a file, you will see a red check mark next to the file; this is similar to TFS’s little edit person icon when a file is in shared edit mode.  To check the file back in, just right click the file, project, or solution and select “Commit…”, “Commit Project Changes”, or “Commit Solution Changes”, respectively.  It’s that easy.

No comments: