Setting Up and Running Subversion and Tortoise SVN with Visual Studio and .NET Source control is an important aspect in software development even if you are not doing team development. It can help you manage your application more efficiently and make sure that your project is backed up and can be rolled back to any revision on the file or project level. I recently got acquainted with the open source Subversion and Tortoise SVN tools and, for the first time, feel that this is source control that I can live with comfortably. This article describes all you need to know to get started with Subversion and Tortoise SVN for Visual Studio projects. This article describes the steps to install and configure the Subversion source control tool and walks you through the basic steps required to set up local Visual Studio projects using Tortoise SVN. | " | Subversion typically runs as a Service either using TCP/IP or HTTP, the latter of which requires Apache.
| " |
This article isn’t meant to be a comprehensive tutorial on Subversion, but rather a quick, what-you-need-to-know, step-by-step guide to the essential tools to install and configure to get up and running. What Is Subversion? Subversion is an open source control repository tool. It is widely used by many open source projects and increasingly by many large development teams in general. It’s fast and efficient, small and easy to install and because it’s open source-it’s also free. Subversion is file based and keeps its repository in a simple directory structure that you can copy and back up easily. You can graphically access Subversion via Tortoise SVN, which is an Explorer Shell Extension that provides access to most of Subversion’s command-line interface through Explorer Context menus and overlay icons for files under source control. This actually is very powerful as it lets you use a familiar Explorer interface as your source code browser and, more importantly, because it very easily lets you see source control files in relation to the actual directory structure and what is and isn’t under source control. Subversion subscribes to the Copy-Modify-Merge philosophy of source control, which means that files are never locked and nobody ever “owns” a file. Rather Subversion manages changes by merging source files with any changes made and only notifies you of conflicts if there are changes that cannot be merged (i.e., changes to the same line of code typically). Coming from a background of using integrated security in Visual Studio, I at first had my doubts about the merge approach. However, I’m finding that it allows considerably smoother development as you don’t have to worry about constant check-out/check-in scenarios and locking files for other users. Instead you simply work on your code and when you’re done you can check in all changes using Tortoise SVN. Not having source control inside of Visual Studio may sound like blasphemy if you’ve used Visual SourceSafe, Vault, or another source code control provider before. I was skeptical about lacking Visual Studio integration when I started out, but I find I really don’t miss the integration with Visual Studio. More importantly, I don’t miss the problems that go with integrated source control in Visual Studio with the provider manager often getting confused, especially in complex Visual Studio Solutions and shared project scenarios. Subversion has actually made many scenarios that used to royally suck and required constant fiddling with Visual Studio and the source providers much easier. Subversion is based on a file system tracking mechanism, so it is essentially tool agnostic. In fact, I use Subversion now with my .NET projects as well as with my old FoxPro projects-the process is no different, which is great for consistency and allows storage of all sorts of files from documentation to support files that otherwise wouldn’t be part of a Visual Studio project. Installation To start, download Subversion and Tortoise SVN and install both. You can download Subversion from here: http://subversion.tigris.org/ You can download Tortoise SVN from here: http://tortoisesvn.tigris.org/ If you want Visual Studio integration, check out VisualSVN ($49) or the free Ankh tool: http://www.VisualSvn.com/ http://ankhsvn.tigris.org/ Start by installing Subversion, and then install Tortoise SVN. Tortoise works as a front-end UI to Subversion. Both need to be compatible, so you should always install the latest version of each. I’ll walk you through the process of creating a new repository and adding a Visual Studio Solution with a couple of projects to it. If you are not setting up a new repository and just need to create a local copy from Subversion repository, just skip ahead to the Creating a Local Copy section.
Configuration for Tortoise SVN Before doing anything else, I suggest you make one small configuration change in Tortoise SVN-change the name of the local svn repositories from .svn to _svn. Make sure you’ve installed Tortoise SVN. Go into Explorer and right-click anywhere on a file or folder. On the shortcut menu, choose TortoiseSVN and choose Settings and check the “Use ‘_svn’ instead of ‘.svn’” check box on the General tab as shown in Figure 1.  Figure 1: It’s a good idea to set up Tortoise SVN to use _svn instead of .svn, since Visual Studio has issues with directories that start with a period.Visual Studio has issues with folders that start with a period so it’s best to use the _svn prefix, especially if you decide later on to use a tool that integrates with Visual Studio. | & | | 
By: Rick Strahl Rick Strahl is president of West Wind Technologies in Maui, Hawaii. The company specializes in Web and distributed application development and tools, with focus on Windows Server Products, .NET, Visual Studio, and Visual FoxPro. Rick is the author of West Wind Web Connection, West Wind Web Store, and West Wind HTML Help Builder. He’s also a C# MVP, a frequent contributor to magazines and books, a frequent speaker at international developer conferences, and the co-publisher of CoDe Magazine. For more information please visit his Web site at www.west-wind.com or contact Rick at rstrahl@west-wind.com.
rstrahl@west-wind.com | Fast Facts | | Find out how to set up and configure the free, open source Subversion source control system quickly and easily. | |
|