Quick and easy version control ideas.
Posted 09.18.2011
As a web developer I'm often moving my work files between my computer at home and my computer at work. Since these files are in a constant state of flux, I also create a lot of backups. Any time you are creating and editing a lot of files, and generating backups of those files as you go, you need a way to conveniently store and move that data.
The short answer is to use an archive utility to create a .zip .tar or .rar file of your project. Then copy that archive to your dropbox account or mail it to your gMail account. If you would like more information, read on.
Keeping your work files portable.
Depending on project size, and type of files you generate you may be able to take advantage of some free or inexpensive options. ...But you need to take a look at how you deal with your files first. If you have large amounts of media like video or stock photos or art, you may want to keep copies of the source files both at home and at work. I also try to keep that kind of data backed up on a portable hard drive so I always have it with me.
For smaller projects, or for specific portions of greater projects, you can use services like dropbox or gMail to act as a personal version control utility. I tend to use dropbox simply for its ease of use and cross platform usability. The advantage that Gmail brings to the table is that you probably already have an account and it's rather hefty storage limit.
Keeping your work files safe.
The main things I worry over when it comes to my work files are:
1) Losing the files because of a storage device failure.
2) Overwriting a file by accident.
My solution is based on redundancy. When I create an archive of my project, I immediately copy that archive to my dropbox account and I back it up to a flash drive. When I have so many archived versions that It's taking up too much space I remove some of the oldest archives from dropbox, I almost never completely delete an archive file though, since storage is cheap I usually keep even the oldest files backed up on a spare drive.
If you are in a situation where more people than just you may need to access the same files at the same time, you need to be looking into programs like SVN or CVS or some service that provides more robust versioning that what we are discussing here.
Security
As much as possible I try to keep sensitive information like passwords and such out of my work files, but sometimes there will be an occasion when that isn't possible, for example: programs you used to connect to your database. If you are storing or moving that kind of information you may want to use something like truecrypt to help safeguard your data.
Separating your development, resource and production files.
I tend to break the internal files for a given project into two major parts, at least as far as storage and portability are concerned.
The project folder is usually named the same as the site that I'm building. So for example, the name of the project for this site would simply be "coderazor.com".
Inside that project folder you will find a folder called _resources, and then all the other folders and files for the site. It's really the underscore that I use as an indicator... Any folder preceded with that underscore is meant for building the site, but is not a file meant for a production or live environment. This makes sorting out what gets pushed live an easy task.
Archive your work files.
I like to generate a backup of my work anytime that I'm about to make a major change. A big change is any change where, if things go wrong it would be difficult or time consuming to get back to that starting point.
I also generate an archive file when I'm done working at that location.
My process is simple...
I create a .zip or .rar file of the project folder and then add to the name of that file a sequence number. So using our earlier example "CodeRazor.com.zip" becomes "CodeRazor.com_034.zip". You can also add yourself a little note, such as "CodeRazor.com_033-PreFork.zip". I create a PreFork version before I make some fundamental code, architecture or programming change.
At the time of this writing, all of my archives together take up roughly 125MB. But mind you, I tend to do my design work in code as opposed to in photoshop, so that's a pretty small archive. The total size of the CodeRazor.com website, including the webDev area that I use for testing and such is still under 1.5MB, excluding that folder the site is under 200KB.