Using Subversion to Source Control SharePoint Projects

Recently, I ran across a post from Andrew Connell where he addresses the question of moving content created in a dev environment to another environment, such as QA, staging or production. While the focus of his post was to answer that question, he did bring up an interesting point. Is it possible to use a tool like subversion to source control your SharePoint master pages, page layouts, css files etc?

It most certainly is! Andrew’s blog post will get you started on understanding how to use features and solutions to move files from one environment to another, but for those of you out there need some assistance getting subversion source control up and running, please read on.

http://subversion.tigris.org/ is the home page for the subversion source control project. The first thing you’ll need to do is download subversion. Click on Downloads on the left navigation. If it’s not entirely clear, you have two options here: you can compile the source code release directly, or you can install one of the prepackaged binaries if there is one for your operating system. I am running a Windows Server, so there were a few prepackaged binaries that I could choose from. I didn’t want to have to compile source code. I tested out CollabNet, VisualSVN and TortoiseSVN. Below is a brief summary:

  • CollabNet is an installer package you can download which will install subversion and optionally apache to your server. There is no GUI, so you’ll have to be familiar with running svn commands via the command prompt to setup your respositories. CollabNet also comes with a client for use with subversion.
  • VisualSVN comes with both a server and a client, however, the difference between VisualSVN and CollabNet is that VisualSVN offers a GUI for creating repositories, managing users and managing groups. It’s really simple to use, and I’ve had no issues with it so far. The client portion installs as a plug-in for Visual Studio making it really simple to interact with subversion. It’s important to note that the server product is FREE, however, the client licenses are $49 USD per user.
  • TortoiseSVN as far as I can tell is a free client plug-in for Windows Explorer that allows you to interact with subversion. Again, please note here that TortoiseSVN client does not interact with Visual Studio. You can use TortoiseSVN in conjunction with VisualSVN or CollabNet subversion servers. The solution I eventually settled on and now have implemented is VisualSVN server on my Windows Server box and TortoiseSVN for my clients.
  • Download VisualSVN
  • Download TortoiseSVN
  1. The install of VisualSVN will create a new entry in your Program Files menu called VisualSVN Server Manager. This GUI will give you the ability to create repositories, add users and configure groups. Right click on Repositories and click Create Repository. Give it a name and allow it to create the default structure. If you expand your repository, you will see 3 folders: trunk, tags and branches.
  2. You have a couple of options from here. You can add an existing project that’s already been developed or is a work in progress into subversion or you can create a new project that is source controlled before any development begins. I’ll outline the latter briefly, you can expect to see a post about source controlling existing projects later this week.
  3. Once you’ve created your repository, expand that repository, click on the Trunk folder and select Copy URL.
  4. Using TortoiseSVN, you can right click within any folder in Windows Explorer and select SVN Checkout from the context menu.
  5. Paste the url you copied in step 2 in the URL of repository: field. Select the checkout directory and click Ok.

,

No comments yet.

Leave a Reply