views:

218

answers:

2

I'm very new to Version Control, and I was wondering if I could get some advice on how it can fit into website design.

At the moment I'm working on a typical, simple website that includes images:

  • A few .html files and a .css file
  • One folder full of photographs
  • Another folder with the corresponding thumbnails

Can I just put the whole lot in a repository? Or is there a better way I could apply Version Control to it? How should I deal with the images?

edit:

How well will it work with changes to the images? What if I decide to try and optimise my photographs or resize them. I wont be able to see what exactly changed about the images, should comments be enough to keep track of that?

+1  A: 

Unless you have a compelling reason not to, I don't see why you couldn't put the images into the repository.

John Weldon
Will mercurial recognize when they are modified?
NickLarsen
yes, is that what you want?
John Weldon
+2  A: 

One common practice is to decide what files you would need to publish the site, then include those files in your DVCS. If you eventually adopt a build server/continuous integration server, it will check out your code from your repository, run tests on it, compile it, then publish it to your testing/production server. To do that, you'll need to include all necessary files.

You should not include unnecessary files that may change often, but signify nothing. For the ASP.NET world, those include .suo, .user, resharper files. If you have an uploaded files folder, you could excluded that as well so files that you test upload don't get included. Basically, anything of that nature.

Clarification

Regarding the "uploaded files folder" thing. If you site supports user's uploading files and they are stored inside the site's directory, say in a folder called "Uploads", then you would want to exclude such a folder from the source control. This is just an example of the kind of thing you wouldn't want to include. While testing, you would test uploading files to your site, but you certainly wouldn't want those test uploads published to production, so keep them out of source control.

Michael La Voie
Okay, so it sounds like it's fine to just include all of my website files in my repository. I don't quite understand this bit: "If you have an uploaded files folder, you could excluded that as well so files that you test upload don't get included", what's an uploaded files folder?
Acorn