Setting up an Online Repository
January 2024
This article describes the process of setting up an online SVN repository and discusses a few options. For details on using SVN source control in general, see Using Subversion for Source Control with the Source SDK.
Contents
Why Do I Need a Repository?
The biggest benefit is to combine changes made by all members of the mod team into a single "current" copy. If you're working on a mod by yourself, you probably don't need an online repository; however, an offline one will still give you many other benefits, which online repositories also provide. If you break something, you can easily compare the previous version (or roll back to them), and easily keep track of exactly what things you've changed since the previous version. Also, if valve updates the source code, a repository can make the task of merging the two versions of the code considerably easier.
Getting Started
First up, you'll need an SVN client. TortoiseSVN (http://tortoisesvn.tigris.org) is recommended.
Next, you'll need someone to host your repository. Here, you have 3 options: a free repository for an open-source mod, a free repository for a closed-source mod, and a paid-for repository for a closed-source mod.
Hosting Options
Free, Open Source
Google code or SourceForge are the logical places to look here. Anyone can download (but not upload) your mod's source. It is debatable whether it's legal to make valve's code publicly available, as they only make it available to owners of the source SDK. It would be useless for someone without access to source SDK, but this isn't exactly legally relevant. There are a few mods that are open source, and no one seems to have complained so far, but ultimately I'm not sure of the legal ramifications. Ask Valve! Also, BitBucket can be a good alternative to GitHub's paid-for hosting. You can invite up to 5 members and create an infinite number of repositories.
Free, Closed Source
The options here are more limited. Apparently, Multiplay.co.uk will offer free hosting for multiplayer mods on the condition that you provide them with quarterly progress updates.
Unfuddle (http://unfuddle.com/) offers free SVN hosting, along with ticket tracking, milestones, etc. Also has public and non-public access to your source tree.
Paid-for, Closed Source
My own experience is with the angel scheme ($5 per month, max of 5 users) of Project Locker (http://www.projectlocker.com), which has provided consistently good service.
Local Setup
Select a host, sign up for an account, and take note of your repository address. Create a mod & build the code, then you just need to work out what will go in the repository.
Choose a folder to be your local working copy, and ensure that the source code is in it. If you have space on your repository, it can be a good idea to include the mod directory as well. Say your working copy has two folders in it, src (containing the source code), and GameDir (which contains a copy of your mod folder).
Now that you have Tortoise SVN installed, right-click this folder, and choose SVN Checkout. Enter your repository address, and hit ok when it warns you that there's already stuff in this folder. Once that's done, you're going to want to commit your first version to the repository. It's recommended that you do this before starting any source code changes, just to be safe.
Your First Commit
Right-click the folder again and choose SVN commit. Every file in the directory will be listed in a pane in this popup. First, check them all (you can push Home, ⇧ Shift+End, then Space to check them all). There are some files that you won't want to be put in the repository, however, so make sure that you set it to ignore the intermediate output directories for both client & server (named, e.g., Debug_HL2MP, Release_HL2MP)—those files are large and will just waste space and bandwidth. You should also make sure that any .pdb and .ncb files are excluded (these are user options and intellisense data for visual studio, and will have the same names as the project files, with different extensions.
You're now ready to go, so hit Commit and take a break while it uploads. Congratulations! You can now screw your mod up as much as you like, as you have a safe backup.