如何保持Subversion和远程服务器(通过FTP)同步? [英] How to keep Subversion and a remote server (via FTP) in sync?

查看:155
本文介绍了如何保持Subversion和远程服务器(通过FTP)同步?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们很难保持Subversion和FTP同步。有时我们忘记提交更改,而只是将它们推送到Web服务器,我们的.svn文件夹分散在整个Web服务器中,有些东西在一个地方存在,而另一个地方则不存在,等等。

We are having a hard time keeping Subversion and FTP in-sync. Sometimes we forget to commit changes and just push them to the web server, we have .svn folders scattered throughout our web server, some things exist one place and don't exist in the other, etc.

今天我想花点时间解决这个问题。解决办法是什么?有没有一种方法可以将SVN链接到我们的Web服务器,以便我们可以通过FTP提交到存储库和Web服务器?我们是否应该向我们的网络托管服务商请求其他一些可以更好地与SVN存储库同步的系统?我们如何强制存储库和Web服务器都同步?我们如何删除.svn文件夹?

I want to take the time to fix this, today. What is the solution? Is there a way that SVN can be linked to our web server, so that we can commit to both the repository and to the web server via FTP? Should we ask our web host for some other system that would better sync with the SVN repository? How do we enforce that the repository and the web server are both in sync? How do we remove the .svn folders?

正如标题所述,我们如何使SVN存储库和Web服务器保持同步?

推荐答案

我在服务器上执行的操作是检查服务器上的代码。

What I do on my server is have it be a checkout of the code on the server.

因此,我没有使用ftp将东西推送到服务器,而是登录并运行 svn up 。通过这种方式手动执行此操作,您将获得许多好处,包括在有错误代码的情况下进行回滚的功能。

So instead of using ftp to push things to the server, I just log on to it and run an svn up. By doing this manually this way you gain several benefits, including the ability to roll back in the event of buggy code.

我还建议您使用数据库迁移系统(假设您使用的是数据库)。这样一来,您便可以轻松地回滚数据库架构更改,以确保您的代码在回滚的情况下仍能继续工作。

I'd also recommend using a db migration system (assuming you're using a database). That'll allow you to easily roll back db schema changes to make sure that your code will continue to work in the event of a rollback.

将这些与类似的工具结合在一起到 Fabric Capistrano ,将为您提供非常强大的部署系统。

Combining these with a tool similar to Fabric or Capistrano, would give you a very robust and powerful deployment system.

关于DVCS的注意事项:

这里有些人提到使用分布式vcs 。其中一些最受欢迎的示例是 git Mercurial (还有其他几种)。

Some people here have mentioned using a distributed vcs. Some of the most popular examples of these are git and mercurial (there are several others).

这两种方法的使用方式都与svn不同,但这并不直接适用于此问题。您可能获得的最大收益是,如果您为每次推送到实时服务器进行标记,则与传统的svn标记模式相比,这样做的成本微不足道。

Both of these have a different usage pattern than svn, but that doesn't really apply to this question directly. The biggest gain you could have there is that if you do tags for each push to the live server the cost of doing so is miniscule compared to the traditional tagging pattern for svn.

如果您希望与 GitHub BitBucket 都为 git mercurial

If you wished to expirement with either of those GitHub and BitBucket both offer free repository hosting for git and mercurial respectively.

那是我的强烈支持, dvcs,我的个人偏好是 mercurial

That being said I am I huge proponent of using a dvcs and my personal preference is mercurial.

这篇关于如何保持Subversion和远程服务器(通过FTP)同步?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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