This is the first in a new series showing how to set up version control. I am aiming this primarily at individuals or those working on their own, if anyone would like a discussion about some of the challenges in scaling this approach up then please get in contact or use the comments.
This post will walk you through creating an account at unfuddle where you can host Subversion and Git repositories, and I will concentrate on Subversion for the moment. If you haven’t already installed tools for working with Subversion I suggest you install TortoiseSVN and VisualSVN or Ankh
Disclaimer
I do not work for unfuddle and I am not receiving anything from them for promoting their services; to be honest I haven’t tried any other subversion hosting providers. I’m just going from personal experience. If you have any recommendations please let me know.
Right that said on with the post. There are 5 plans ranging from the Private (which is free!) for single developer projects to Enterprise ($99/mo) for very large development teams. As the focus of these posts is to get a solo developer set up for version control, and because its free, I’ll be using the Private plan. The Private plan only allows 1 Active Project, no Archived Projects and 2 people but unlimited repositories (well limited to 200mb on disk, but things take up less space in a repository than they do as project files so that’s quite a bit of storage). You can upgrade or downsize your plan at any time.
Why would you want to do this?
A valid question to ask at this point is why are we setting this up in the cloud, aren’t there risks with hosting things in the ‘cloud’? Well yes there are, but I think the benefits far outweigh the risks.
Ok yes you could use something like VisualSVN Server to create your own subversion server locally and for some that may be the right thing to do, the advantages I find in hosting with unfuddle are that I no longer need to worry about backing up my projects. This issue is really one of scaling the solution up, so if anyone wants to discuss this further please do use the comments or get in touch. But it is a side issue so I’m going to get on with the post now.
Account Setup
You need to create a subdomain for your unfuddling; I use the name of the project I’m working on, or the name of the company and a Title that’s just used for personalising the site. The Administrator Login is pretty easy stuff – once I’ve created the admin account I tend to link it to an openID and not have to worry about it again.
There’s some helpful instructions explaining what happens next alongside the form:
When you are finished with signup, you will find that a single project titled "My First Project" has automatically been created for you. Feel free to use this project to get comfortable with Unfuddle's features.
Once you have settled in, you can either rename this project and use it for active development, or you can delete it and create a new project.
Now the account is set up you might want to spend a little time exploring the options in the site. I like to tweak things, so have changed the colour theme used and updated my personal settings to show that I'm in the UK...
Creating a repository for your project
Ok so you’ve created your account and have things looking pretty nice to set up a repository from the Repositories tab click New Repository; you just need to give it a friendly Title and an abbreviation (which will be used in the URL), for example http://sjmdev.unfuddle.com/svn/sjmdev_testproject/ (make a note of it, we’ll use it in a minute) then specify the type or repository – in this case I’m using Subversion but Git is also an option, the process is pretty much identical. If you like you can give a description, I haven’t missed it yet, but I am the only one working with my repositories and I know what they are from the Title! It only takes a few seconds for the repository to be set up for you.
That gives you a blank repo(sitory) hosted by unfuddle, the final step is to create the repo structure within it. The recommended approach is to have folders for branches, tags and trunk. The trunk represents the main working copy of your work, and in an ideal world will always result in a project that builds. When you want to do something a bit odd the strategy is to branch off so you have a bit of a play in branches. I use tags for my releases, so will have tag folders for v1.0, v1.5, v2 etc that way I can always go back to a known release of a project. Unfortunately unfuddle doesn’t create this structure for you, so we’ll do that now.
Creating the folder structure
To create the folder structure I know and love I usually follow these steps:
- Create a new folder in my Visual Studio Projects directory, right click the folder and select SVN Checkout, paste the URL of the repository and make sure that the checkout directory is your new folder.
- Inside the new folder create 3 new folders; trunk, branches and tags
- Right click the root repository folder and select SVN Commit… This will send the new folder structure up to your hosted repo.
Next I need to add my solution files to the repository, so I’ll either create a new project inside the /trunk folder or I’ll copy an existing project in there, remember the trunk represents the most current development code.
Why don’t I just put the files in there and then use TortoiseSVN to commit the project along with the folder structure? Well there are some files that just aren’t needed in a repo and VisualSVN comes knowing which files they are. So I like to use VisualSVN to add the project files to a repo structure. So with the files I for my solution in the trunk I’ll open Visual Studio, right click the solution in Solution Explorer and select Add Solution to Subversion – it will confirm the folder you’re adding to and check to make sure all files exist in the folders for the repo, then ask whether this is a new or existing repository. As we’ve already set up the repo select Existing repository and give it the url of the repo, in the examples it shows /trunk in the path and that’s a good reminder that we want to commit the project files to the trunk. In our case this is http://sjmdev.unfuddle.com/svn/sjmdev_testproject/trunk/ – then let it work while it uploads all the files. Finally you want to right click the solution and select Commit, this will push all the Visual Studio files up into the trunk, excluding files like *.suo as these are unique per developer and all .dll files – this can be a problem but it is easy enough to add them if needs be. I will do another post explaining some of the reasons behind this and explain what I do about that, but this just about wraps up this post.
Some useful posts
I used some of these posts when writing my post, they go into a bit more depth about the recommended folder structures and what they’re used for:
46956105-6f66-4aeb-9f5a-10aa19bdbd4b|0|.0
Permalink |
Comments (3)