Pages

Wednesday, April 30, 2008

Using Subversion with Visual Web Developer

*Note: this method doesn't just work for Visual Web Developer, it should work for any software where source files are stored on your local drives. This includes C#, C++, Java, VB, Delphi, C++ Builder, Flash, Poser, etc.

This tutorial will get you started using Tortoise SVN to easily back up and version your websites. If you don't know why this is a great idea, then you've never screwed up your projects so bad that you wasted 3 days trying to get it back to where you started.

Step 1

Find a spot to back up your stuff. I use an external USB drive. There are also ways to do this over the intranet and Internet. You can store your archive (subversion calls this a repository) on your main hard drive, or another computer in your network as well.

Step 2

Download and install Tortoise SVN for windows. Once installed, right-click nearly any file on your system and note the new options that are available (Don't select them yet, just *note* them).

Step 3

Create a folder on your archive drive to put a project in. In my case, on the external drive it's named like this: I:\subversion\Website1.

Then navigate to the parent folder and right-click the project archive folder (in my case this was I:\subversion) and right-click the new archive folder (Website1). Choose TortoiseSVN - Create Repository Here. Select Native Filesystem (FSFS). This takes a few 10ths of a second, and creates files and folders in the archive folder.

Step 4

Now browse back to your websites folder (the place where you have the files to be archived) and right-click the project you want to check in. Select TortoiseSVN - Import. It is important to note that to Tortoise, import means "import to the archive" and export means "Pull it out of the archive". In the import dialog select the archive folder you just created (such as file:///I:/Subversion/Website1. Click OK. The contents of your project will be imported into the repository. Click OK.

Now whenever you change a file in your project, you can upload the changes to the repository, and if you mess it up, you can roll it back in an instant! I'll do more tutorials about using Tortoise SVN later.


Apologies for the delay...

Yes, you must use tortoise to check out the project again. I suggest checking it out to a new folder. There are some Windows sharing settings that will cause errors here if you are saving to a shared drive. I am still looking into this.

3 comments:

Anonymous said...

In the last section of your blogentry you say: "Now whenever you change a file in your project, you can upload the changes to the repository, and if you mess it up, you can roll it back in an instant! I'll do more tutorials about using Tortoise SVN later.". That's all good but what do you mean? Do I click import again? Just becouse I imported the folder it doesn't automagicly becomes soruce controlled, right?

Hobart said...

This is great except that when I get to the import dialog, the URL of repository" drop down is empty. So what do I do about that?

John

Hobart said...

When I get to the Import dialog the "URL of repository" dropdown is blank, and the 3-dotted browse button is disabled. So what do I do?

- John

Share This!

Contact Us

Name

Email *

Message *