Version control means saving your code (and images, models, and everything else) in a database. If you drop your hard drive or your PC gets hit by lightning and you're using remote version control, then no drama - just get a new PC, check out the latest version of your code and carry on. Or if you delete a big chunk of code you don't need any more, then remember that little bit in the middle that took hours to get right - no problem, just step back to an older revision and look at last months code.
Version control used to be a bit tricky, requiring a local install of cvs and some serious unix skills to keep it running, but these days several companies offer free, simple subversion services. Chief among these are Sourceforge and Google Code - both are open source. which means when you save your work there, the rest of the world can see, learn from and use that code. If you're uneasy about that, spend some time here then come back.
I'm going to go through the steps required to get your project hosted on Google Code. Not only is this really useful for development, but it can also act as a community hub and download site for your game when it's released!
Go to http://code.google.com/hosting/ and click on the Create a new project link. Type in your projects name (it will have to be unique across the google code site) and a brief description and click Create Project - and guess what - you're done. I said it was simple. Click on the Settings link in the top right and make a note of your googlecode password. This isn't your normal google password, it's your passport to the subversion repository.
Now to import your work into the new repository. There's a decision to be made here, unfortunately. By convention, svn repositories are laid out a certain way, but Netbeans rides roughshod over that and just plunks the whole project directory into the root. I recommend a middle ground, laying out the repository like so:
- /svn (root)
- branches
- tags
- trunk
- Project1
- src, test, etc
- Project2
- src, test, etc
Go back to NetBeans, right click on your project in the project tree, and choose Versioning->Import into Subversion Repository...
In the space for the repository URL, type "https://myprojectname.googlecode.com/svn", type your google account email address in the username field and in the password field, enter the googlecode password on your settings page from earlier.
On the next page, change the directory from "myproject" to "trunk/myproject" and enter a simple message - something like "New project" is plenty. Now hit finish and the project will be imported into subversion.
If you want to work on the project on a different computer, install netbeans there too and use the Versioning->Subversion->Checkout command. Enter the repository, user name and password info as above (remembering httpS - or you won't be able to write back your changes) and hit next. On the next screen, use the browse button to select the project in trunk/ or just type trunk/projectname, and select your net beans project dir as the local directory.

Now we can go coding off into the sunset without worrying about losing our data.
No comments:
Post a Comment