Sinister Soups Serving Musings On Game Development and Play

18Mar/10325

Source Control For The Hobbyist Developer

I've been working on an XNA game project with some friends in my free time, and as any professional developer knows, it's much more difficult to coordinate changes to a programming project without some sort of source control solution. While we did without in the beginning, it came to be too much of a hassle, and last night I finally set up source control repository for us. I was thinking that it might be helpful to others, and to myself for future reference, to outline the solution I ended up using, and how I set it up.

Firstly, what is source control? Source control is a way to let multiple people edit the same resources, whether that's documents or source code, without their edits stomping on each other. While there are different ways to accomplish this, the method my friends and I are used to involves checking out files from a central repository, editing them independently, and then checking them back into the repository. If multiple people check out the same file, then the first to check changes in can do so freely, while everyone who checks in after that needs to first correct any conflicts their checkins might have with that first person's changes.

Ultimately, for our home work, we wanted a system with a decent GUI, that was simple to use, and worked more or less how we were used to. Since there are a lot of sites out there that will host repositories using the Subversion (or SVN) source control system, and there is a popular shell integration application called TortoiseSVN which allows you to work with SVN without using the command line, this was the system we ended up going with.

The first thing you need to decide if you want to use TortoiseSVN is whether you want to have a local repository on your computer, which you can use to track your own changes to a project you are working on, but which you can't easily give other people access to, or if you want to have the repository stored on a server so that team members on multiple computers can all access and edit it easily.

In our case, the latter was the only logical choice, a local repository only makes sense if you are the only one working on a project, so we looked for a service site that would let us host a repository easily. We ended up going with XP-Dev, a service we chose because it allows free hosting of up to two SVN repositories with 200 MBs of space available, and also gives you a lot of rather nice tools as part of your account to make project management easier, tools like forums, a wiki, a blog, and bug and task tracking.

There are very many different hosting sites like this, however, so you may be able to find one that gives you even more space for free, if you need it, and they all offer subscription options as well that give you more space and unlock more powerful features.

Once you have an account set up, you will be able to create a repository for your project, and you should get a URL that you can use to access your repository. On XP-Dev, the repository URL looks something like this:
http://svn2.xp-dev.com/svn/some_project_name/

At this point, you are ready to install TortoiseSVN; you can get the installer at their download page. While it is installing, consider where you want your project to reside on your computer, you will need a directory that you designate as the root of your repository, so that Tortoise can download a copy of the repository there for you to edit and then check back into the repository on the server. In my case, I wanted to make sure the repository was obvious and easy to find, so I created a directory called D:\SVN\Projectname.

Once you have your directory ready, and Tortoise successfully installed (you will need to restart Windows for the shell integration to work correctly), you can then start setting up your repository. Assuming your repository on the server is empty at this point, move whatever folders you are going to be managing to your SVN\Projectname folder, right-click on the SVN\Projectname folder and select the TortoiseSVN --> Import option.

Import option, with equally relevant SVN Checkout option above it...

You will be prompted for the URL of the repository, which you should have gotten from your hosting service, and when you click OK, for your credentials to access that repository. Assuming there are no hiccups with your credentials, it should then upload the contents of your SVN\Projectname folder to the repository on the server, and the first revision of your project will be up and running!

While this put the files you want into your repository, it doesn't actually register that this directory is a local copy of the repository, and so you won't be able to use Tortoise to check in file and folder changes yet. To do this, you must now right-click on the SVN\Projectname folder, and select the SVN Checkout option, which will download the files back from the repository, and mark them as local copies that you can edit, and later commit to merge them back into the repository.

Once you have done this, you should see the folders in the SVN\Projectname folder with little green check-mark icons on top of them, indicating that they are fully up to date. If you edit any of these files or folders, the icon will change to a red stop sign, and when clicking on any file or folder in the repository directory structure, you will be able to use the SVN Update command to sync up to the newest version of the repository, and the SVN Commit command to check in any changes you have made.

SVN Update and SVN Commit commands available once you have checked out the repository.

A few other useful tips for working with Tortoise and SVN in general:

  • Since Tortoise is a shell extension, all of its functionality can be accessed through the right-click menu in Explorer. There are many nice options here to help you manage your files and your repository.
  • When you go to commit your changes, you will be given a list of files that will be added with your check in, as well as any modified files. You can double-click on any of the files in this list to see the difference between them and make any changes.
  • If the list of files that will be added on a commit includes files built as part of the project, binaries or obj files you don't actually want cluttering up your repository, you can simply right-click these files in the list and choose to ignore entire directories or specific file extensions. Those files and folders will not be uploaded to the repository, and will not show up in subsequent commits.
  • TortoiseSVN has a very nice manual available in the docs section of their website. The manual not only covers Tortoise itself, but also has some good info about SVN and best practices for setting up your repositories and how to use it on a daily basis.

Hopefully, this has been helpful to anyone out there looking for a quick and easy explanation of how to set up source control for a personal project. It seems to be working out pretty nicely for our team, and I wish you good luck in your own endeavors!

Comments (325) Trackbacks (0)
  1. I’d come to clinch the deal with you here. Which is not something I usually do! I love reading a post that will make people think. Also, thanks for allowing me to speak my mind!

  2. I’d need to test with you here. Which isn’t something I often do! I take pleasure in studying a put up that will make individuals think. Also, thanks for permitting me to comment!

  3. Pattaya tourism business uses the lengthy list of entertainment choices to stay the vacationers glued to the city.

  4. Spot on with this write-up, I truly think this website needs much more consideration. I’ll probably be again to read much more, thanks for that info.

  5. Nice post. I learn something more challenging on different blogs everyday. It will always be stimulating to read content from other writers and practice a little something from their store. I’d prefer to use some with the content on my blog whether you don’t mind. Natually I’ll give you a link on your web blog. Thanks for sharing.

  6. http://theprosoccershop.com I precisely wanted to thank you very much again. I am not sure the things that I could possibly have sorted out in the absence of the entire concepts discussed by you over such problem. This has been a real daunting issue in my circumstances, nevertheless spending time with your specialised technique you dealt with that made me to jump over happiness. I’m happier for the help and as well , hope that you are aware of an amazing job that you are providing training others through a blog. Most likely you have never got to know any of us.

  7. You made some first rate points there. I appeared on the web for the difficulty and located most people will associate with with your website.

  8. wow, hebat, aku bertanya-tanya bagaimana menyelesaikan masalah saya. dan kemudian menemukan situs Anda dengan google, saya belajar banyak, dan sekarang sudah agak jelas. Saya sudah bookmark situs Anda dan juga menambahkan rss. stay updated ya!!

  9. link for you on my blog here http://www.conveyancingquotes.info/?page_id=9 ,I like this web site so much, saved to favorites .

  10. Thanks for the writeup. I definitely agree with what you are saying. I have been talking about this subject a lot lately with my father so hopefully this will get him to see my point of view. Fingers crossed!

  11. I would like to consider the chance of thanking you for your professional suggestions I have constantly enjoyed checking out your site. We’re looking forward to the commencement of my college research and the overall planning would never have been complete without visiting this site. If I can be of any help to others, I will be glad to help by what I have learned from here.

  12. sublime listing you admit

  13. My partner and i still can not quite think that I could always be one of those reading through the important ideas found on your web site. My family and I are sincerely thankful on your generosity and for presenting me possibility pursue my own chosen career path. Appreciate your sharing the important information I obtained from your web-site.

  14. I’m not sure where you’re getting your info, but good topic. I needs to spend some time learning much more or understanding more. Thanks for fantastic info I was looking for this info for my mission.

  15. Many thanks for being the instructor on this topic. My partner and i enjoyed the article greatly and most of all cherished the way you handled the aspect I regarded as being controversial. You’re always rather kind to readers like me and let me in my living. Thank you.

  16. Hey very nice blog!! Man .. Excellent .. Amazing .. I’ll bookmark your blog and take the feeds also…I am happy to find numerous useful information here in the post, we need develop more techniques in this regard, thanks for sharing. . . . . .

  17. *After study a few of the blog posts on your website now, and I truly like your way of blogging. I bookmarked it to my bookmark website list and will be checking back soon. Pls check out my web site as well and let me know what you think.

  18. I’m having a small issue. I cannot subscribe to your rss feed for some reason. I’m using google reader by the way.

  19. Just added this blog to my favorites. I enjoy reading your blogs and hope you keep them coming!

  20. Hello, what blog software in your opinion is the best one? I’m thinking of starting with movable type, you think that’s what I should do? Thank you.

  21. hello, what blogging engine software in your opinion is the easiest for a first time blogger? I’m thinking of starting with drupal, do you think that is what I should do? Thank you.

  22. *I discovered your blog site on google and check a few of your early posts. Continue to keep up the very good operate. I just additional up your RSS feed to my MSN News Reader. Seeking forward to reading more from you later on!…

  23. I actually still cannot quite feel that I could become one of those reading through the important recommendations found on your blog. My family and I are sincerely thankful for the generosity and for presenting me opportunity pursue my personal chosen profession path. Many thanks for the important information I acquired from your blog.

  24. *An interesting discussion is worth comment. I think that you should write more on this topic, it might not be a taboo subject but generally people are not enough to speak on such topics. To the next. Cheers

  25. Nice post. I be taught something more challenging on different blogs everyday. It can at all times be stimulating to read content from different writers and observe a bit something from their store. I’d choose to use some with the content material on my blog whether or not you don’t mind. Natually I’ll provide you with a hyperlink in your web blog. Thanks for sharing.


Leave a comment

You must be logged in to post a comment.

No trackbacks yet.