Acorn
Acorn

Reputation: 50567

Using mercurial for web-design version control (dealing with images)

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:

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?

Upvotes: 7

Views: 1065

Answers (2)

Michael La Voie
Michael La Voie

Reputation: 27926

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.

Upvotes: 3

John Weldon
John Weldon

Reputation: 40789

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

Upvotes: 1

Related Questions