开发者

Should a website's images folder and images be stored in SVN repository?

I'm currently importing all of our PHP websites into SVN repositories. Each site has a images folder which contains all the sites images. The images are updated quite frequently as most of them are offer graphics.

Should the images (binaries) be s开发者_JAVA技巧tored in the repository?

The other issue is that they are updated all the time. How would you update images frequently that are in your working copy as you can't edit the source in a text edit like you would a source file they would need to be replaced with updated images, how would the version system handle this?


SVN is capable to handle binary files, including (but not limited to) images. You can use it like a normal text file. The only difference is once changed, it's changed as a whole, not as a patch like normal text files.


If you want to see a "SNAPSHOT" of your site in a given time (Track the appearance in history) then the answer is YES :).


We tend to try not to include "content" type images (or other binaries) in SVN, as many of the sites we deal with have large collections of high-res images and PDFs for users to download. These make the checkout from SVN, for a developer who's just working on the code, a very long task.

One idea was to have two separate repositories; one for code and one for "non-code" binaries (i.e. general content). Then create a "release" script for each site which can export the appropriate parts of each repo to create a complete site. That also means our content team can play around with content binaries without risking them getting their sticky fingers into the code repo ;)


As you define your project as a "website" I think you should keep.. You'll know that your entire project is in the same place, versioned, backed up. Your images are a part of your project as well.. They also change often or worked by multiple people.

SVN can hold and version different types of files... Of course there are some limitations on binary files. But you can still enjoy hassle-free working among teams with SVN.

Using hook scripts is a good way to deploy your site on FTP hosts or on your local computer. By using a simple post-commit script you can copy your site to a test URL and avoid copying the site each time someone makes changes..

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜