使用 Mercurial 进行网页设计版本控制(处理图像)

发布于 2024-08-30 10:50:13 字数 347 浏览 5 评论 0原文

我对版本控制非常陌生,我想知道是否可以获得一些关于它如何融入网站设计的建议。

目前,我正在开发一个典型的简单网站,其中包含图像:

  • 一些 .html 文件和一个 .css 文件
  • 一个充满照片的文件
  • 夹 另一个带有相应的缩略图

我可以将全部内容放入存储库中吗?或者有更好的方法可以应用版本控制吗?我应该如何处理图像?

编辑:

它对图像的更改效果如何?如果我决定尝试优化我的照片或调整它们的大小怎么办?我无法看到图像到底发生了什么变化,评论是否足以跟踪它?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无力看清 2024-09-06 10:50:13

一种常见的做法是确定发布站点所需的文件,然后将这些文件包含在 DVCS 中。如果您最终采用构建服务器/持续集成服务器,它将从存储库中检查您的代码,对其运行测试,编译它,然后将其发布到您的测试/生产服务器。为此,您需要包含所有必要的文件。

您不应包含可能经常更改但没有任何意义的不必要文件。对于 ASP.NET 世界,这些包括 .suo、.user、resharper 文件。如果您有已上传的文件夹,您也可以将其排除,这样您测试上传的文件就不会包含在内。基本上,任何具有这种性质的东西。

澄清

关于“上传的文件夹”的事情。如果您的网站支持用户上传文件,并且它们存储在网站的目录中,例如在名为“Uploads”的文件夹中,那么您可能希望从源代码管理中排除这样的文件夹。这只是您不想包含的内容的一个示例。在测试时,您将测试将文件上传到您的站点,但您肯定不希望将这些测试上传发布到生产环境,因此请将它们置于源代码控制之外。

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.

万劫不复 2024-09-06 10:50:13

除非您有令人信服的理由不这样做,否则我不明白为什么您不能将图像放入存储库中。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文