开发者

Correct structure and way of website versioning

Recently I use GIT to version my website. It makes it all really easy to see how my project develops and I always have save backups on different places on the web.

Now my main question is if it is recommended to version your whole root of the website. I have a basic structure that looks something like this:

/httpdocs
  /config
  /media
  /application
  index.php
  .htaccess

1) Should I use the /httpdocs folder to version, or should I use the content of the folder.

2) Is it recommended to version the media folder.

In the media version I have several images for the overall layout, and some other images for the website. These images can be quite large. I work on these images from time to time and so they change. I hardly开发者_JAVA技巧 never need the old image again, so is this not just taking up precious storage space.

I would highly appreciate just some basic recommendation on this topic.


What are you worried about?

Version control seldom introduces a disk space problem that wouldn't have existed otherwise. If you're just worried about potential problems, I'd file this under premature optimization. If you have a real disk space issue, I'd buy another disk. Disks are cheap. It doesn't sound like you're changing the image often enough for this to be cost-prohibitive.


Firstly, I have to say that I mainly work with SVN and desktop apps but the ideas should be roughly the same.

  1. I would not add httpdocs to source control, just the contents of httpdocs, unless there are references to the folder within your content, e.g relative paths that specifically have httpdocs in them.

  2. I would version the media folder, simply because I can checkout/export a particular version of the web site immediately with the exact images as of that version.

    Sometimes, the dimensions of the same image might have differed between versions so it's always good to get that exact image used by a particular version of he website.

    Besides, you'll never know when a client wants to rollback to a previous version of an image.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜