处理 SVN 和 FTP 以及在服务器上创建/更改的动态文件?
基本上我有各种项目,所有版本都使用 subversion 进行控制。这有很多原因:备份文件以防将来出现错误/问题;在本地系统出现故障等情况下备份文件;公司其他人的协作;我们
使用的系统之一是 Wordpress,它通过其管理面板等更新和安装插件,再加上安装它,系统会创建各种文件(包括 wp-config.php 文件和 .htaccess 文件)。这意味着在安装时,服务器上存在与系统运行集成的文件,这些文件不在本地系统上,也不在 svn 中。另外,任何已安装的插件和更新都不会镜像在版本控制或本地副本中。
另外,使用相同代码的两份副本(一份在版本控制中,一份在服务器上)感觉是错误的(特别是当您与数据库等中的数据规范化进行比较时)。
所以我的问题是我是否以正确的方式使用这些工具?有什么方法可以让服务器上的 public_html 文件夹“指向”存储库中的最新版本吗?或者可以将 SVN 配置为从 public_html 文件夹中读取并自动添加+提交在服务器上创建/编辑的任何文件吗?
或者人们只是从字面上下载任何被更改/创建的内容并手动将它们添加到 SVN 中?还是人们不关心?也许我误解了 SVN 的用途?我正在使用它来有效地进行备份。
谢谢
汤姆
Basically I've got various projects all version controlled using subversion. This is for many reasons: backup of files in case of bugs/issues in the future; backup of files in case of local system failure etc; collaboration from others in the company; etc..
One of the systems we work with is Wordpress which does updates and installs plugins through its administration panel and such, plus on installing it the system creates various files (including a wp-config.php file and a .htaccess file). This means that on install there are files on the server integral to the running of the system which aren't on the local systems and aren't in svn. Plus any installed plugins and updates aren't mirrored in version control or the local copy.
Plus it feels wrong (specifically when you compare with data normalisation in databases and such) to be working with two copies of the same code - one in version control and one on the server.
So my question is am I using the tools in the right way? Is there any way that the public_html folder from the server can "point" to the latest version in the repo? Or can SVN be configured to read from the public_html folder and automatically add+commit any files created/edited on the server?
Or do people just literally download anything that gets changed/created and add them to SVN manually? Or do people not care? Maybe I've misinterpreted what SVN is for? I'm using it for backup effectively.
Thanks
Tom
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我只对我自己的 WordPress 主题进行了版本控制。包括数据在内的所有其他内容都位于服务器上,并且仅从那里进行备份。
wordpress 的代码和使用的插件是在其他地方开发的,他们有自己的存储库,我不会用我永远不会碰的代码弄乱我的代码。
问题是如何处理配置。我目前正在运行一个 wiki,其中记录了所有实时安装的插件以及我设置的配置属性。
实时到本地的同步如下所示:
I only have versioned my own wordpress theme. All the other stuff including the data is live on the server and solely backuped from there.
The code of wordpress and the plugins used are developed elsewhere, they have their own repositories, and i do not mess mine with code I never will touch.
The question is how to deal with configurations. I am currently running a wiki where I document all the plugins installed live and what configuration properties I have set up.
A sync of live to local then goes like this:
在许多情况下,您的主机提供定期备份。但是如果您使用 VPS,您就可以更自由地做任何您想做的事情。我已将 public_html 文件夹置于版本控制之下,并创建了一个小脚本以每晚提交。这样我就可以获得网站的完整版本历史记录并跟踪更改。您还可以创建一个脚本来将此文件夹复制到其他地方。对于企业来说可能还有其他更好的解决方案,但这对于小型项目可能就足够了。
In many cases your hosting provides regular backup. But is you use VPS you have more freedom to do whatever you want. I have made my public_html folder under version control and created a small script to commit every night. So I can have a complete version history of my site with changes traced. You can also create a script just to copy this folder elsewhere. There may be other better solutions for enterprises, but this may be enough for small project.