有在文档根目录的文件SVN'ed最新版本 [英] Having latest copy of SVN'ed files in document root

查看:107
本文介绍了有在文档根目录的文件SVN'ed最新版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

前阵子我问<一个href=\"http://stackoverflow.com/questions/567971/how-to-set-up-svn-with-files-that-are-in-an-htdocs-directory-structure\"相对=nofollow称号=这个问题>链接文本,我得到了一些伟大的答案。如果有一种方法来保持在我的Web应用程序文档根目录中的文件,当我做出改变,把它们提交回库我想知道的是。

据我了解,为了上的文件工作,他们不能在Web根目录。无需将它们搬出去别的地方只是为了对他们的工作似乎违反直觉给我。我缺少的东西吗?

谢谢!


解决方案

  

以上的文件,他们不能在网站根目录


有没有道理的。也许你正在考虑一个事实,即它可以修改/ Web服务器编辑的文件的不应该是文档根目录下。但只要你不使用服务器本身做编辑(这将是这种情况如果说,您创建某种文本编辑器的Web应用程序),它是完美的罚款和一个完全正常的做法是在编辑文件文档根目录。

您可能会感兴趣像我的设置:我有我持有相同的物理机器上网站,我的网络服务器的存储库。一个工作副本检出到该计算机上的Web根,我有另外一个工作拷贝签出我的笔记本电脑,在那里我做我的开发和测试。现在最有趣的部分:我添加了一个钩SVN仓库,这样每次什么东西被提交到存储库,它会自动更新在网站根目录的工作副本。通过这种方式,Web根总是有网站code的最新版本,但我仍然可以在网站上运行,而无需对服务器的访问。

修改的:这里的脚本

A while back I asked link text and I got some great answers. What I would like to know is if there is a way to keep the files under my web applications document root, and when I make a change, commit them back to the repository.

From what I understand, in order to work on files, they can't be in the web root. Having to move them out to somewhere else just to work on them seems counter-intuitive to me. Am I missing something?

Thanks!

解决方案

in order to work on files, they can't be in the web root

There's no truth to that. Maybe you're thinking of the fact that files which can be modified/edited by the web server shouldn't be under the document root. But as long as you're not using the server itself to do the editing (which would be the case if, say, you created some kind of text editor web application), it's perfectly fine and a completely normal practice to edit files in the document root.

You might be interested in something like my setup: I have the repository which holds my website on the same physical machine as my web server. One working copy is checked out into the web root on that machine, and I have another working copy checked out on my laptop, where I do my development and testing. Now the fun part: I added a hook to the SVN repository so that every time anything is committed to the repository, it automatically updates the working copy in the web root. This way the web root always has the latest revision of the website code, but I can still work on the site without having access to the server.

EDIT: here's the script

这篇关于有在文档根目录的文件SVN'ed最新版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆