Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

dvcs

mercurial

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?

like image 476
Acorn Avatar asked Apr 28 '10 17:04

Acorn


2 Answers

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.

like image 102
Michael La Voie Avatar answered Nov 09 '22 09:11

Michael La Voie


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

like image 32
John Weldon Avatar answered Nov 09 '22 09:11

John Weldon