如何使用未版本控制副本中已更改的文件更新存储库中的网站文件

发布于 2024-08-18 08:32:08 字数 698 浏览 4 评论 0原文

我已经在包含网站的开发中设置了 SVN 存储库。网站文件是几天前使用 svn import 导入的。

我在同一台服务器上也有一个处于未版本控制状态的相同网站,该服务器是我们实时生产服务器上的镜像或网站。如果我们的实时服务器崩溃,我们可以通过 FTP 快速重新上传所有站点。镜像由 rsync 处理并且运行良好。

我的同事目前还没有使用 SVN,因为这是一个新流程,而且他们还没有接受过培训。他们仍然通过 FTP 下载文件,在本地编辑并重新上传。因此需要SVN。

在我们进行切换时,我需要使站点的存储库版本与实时生产版本保持同步,因为他们仍在使用 FTP,并且自从我几天前导入站点以来可能已经进行了更改。

我需要知道的是,如何将从镜像非版本控制副本更改的文件重新导入到存储库中。我不想删除存储库并创建新的存储库并导入,因为我想保留当前版本历史记录。所以我希望实现的是任何已更改的文件都将作为新修订版导入。

我尝试过的

我尝试创建该网站的工作副本,就像它在存储库中一样。然后在工作副本和未版本控制的镜像副本之间使用 rsync。唯一的问题是所有 .svn/ 文件夹都从工作副本中删除,因为它们不存在于镜像(无版本控制)版本中。

有没有办法让 rsync 保留工作副本上的 .svn/ 目录,即使它们不存在于源站点上?

或者是否有更好的方法将任何更改的文件更新到存储库中?

I have set up a SVN repository on a development that contains a website. The website files were imported using the svn importa few days ago.

I also have the same website in an un-versioned state on the same server which is a mirror or the site on our live production server. This is in-case our live server crashes we can quickly reupload all the sites via FTP. The mirroring is handled by rsync and is working perfectly.

My colleagues are not currently using SVN yet because it's a new process and they have not yet been trained. They still FTP files down, edit locally and re-upload. Hence the need for SVN.

I need to keep my repository version of the site up to date with the live production version while we change over as they are still using FTP and have probably made changes since I imported the site a few days ago.

What I need to know is how can I perform a sort of re-import into the repository of just files that have changed from my mirrored un-versioned copy. I don't want to drop the repository and create new one and import because I would like to keep the current version history. So I what I hope to achieve is that any files that have changed would be imported as a new revision.

What I have tried

I tried creating a working copy of the site as it is in the repository. Then using rsync between the working copy and the un-versioned mirror copy. The only problem is that all the .svn/ folders a deleted from the working copy as they don't existing in the mirror (un-versioned) version.

Is there a way to get rsync to preserve the .svn/directories on the working copy even though they don't existing on the source site?

Or is there a better way to update any changed files into the repository?

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

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

发布评论

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

评论(2

起风了 2024-08-25 08:32:08

难道不能将更改后的源代码树复制到工作副本上,然后提交吗?

另外,您可以将 --exclude ".svn" 传递给 rsync。了解rsync 排除此处

rsync 中还有 --cvs-exclude 参数,但您必须检查您的 rsync 版本是否支持 svn,因为补丁相当新。

Can't you just copy the changed source tree over a working copy, and then commit it?

Also, you can pass --exclude ".svn" to rsync. Read about rsync exclusion here.

There's also the --cvs-exclude parameter in rsync, but you'd have to check if your version of rsync supports svn with it, as the patch is quite new.

隔纱相望 2024-08-25 08:32:08

rsync -azcC --exclude=.svn /path/to/unversioned/source/ /path/to/working/copy/

rsync -azcC --exclude=.svn /path/to/unversioned/source/ /path/to/working/copy/

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