如何从服务器删除 svn 标记版本并将它们保留在存储库中?

发布于 2024-12-09 06:18:36 字数 294 浏览 0 评论 0原文

我接管了一个使用 Subversion 的 Web 应用程序。当代码发布时,会在存储库中创建一个标签,然后在服务器上使用“svn update”命令将发布代码更新到最新版本。

这个过程效果很好,但已经持续了两年多,现在网络服务器上有超过 100 个标签,加起来超过 10 个演出。它们所在的分区已满,我想删除旧标签并仅保留当前标记的版本。

据我了解,标签包含版本控制信息并且相互依赖。我尝试从服务器中删除旧标签,但是一旦我运行“svn up”,它们就会返回。我想做的事情可能吗?我可以在服务器上只拥有最新的标签,还是需要开始考虑新的部署流程?

I've taken over a web application that is using Subversion. When the code is released, a tag is created in the repository, and then the 'svn update' command is used on the server to bring the release code up to the latest version.

This process works great, but it has been going on for over 2 years, and now there are over 100 tags on the webserver and add up to over 10 gigs. The partition they are on is getting full, and I would like to remove the older tags and keep only the current tagged version.

From what I understand the tags contain versioning information and are dependent upon each other. I've tried just deleting the old tags from the server, but as soon as I run 'svn up', they return. Is what I want to do possible? Can I only have the most current tag on the server, or do I need to start thinking of a new deployment process?

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

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

发布评论

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

评论(2

一花一树开 2024-12-16 06:18:36

为什么要检查所有标签?
使用 svn co <​​a href="http://repo/tags/v1.0">http://repo/tags/v1.0 查看当前标签
当您想要更新网络服务器时,请切换到新标签,svn switch http://repo/tags/v1.1

Why do you have all your tags checked out?
Checkout the current tag with svn co http://repo/tags/v1.0
When you want to update the webserver you switch to the new tag, svn switch http://repo/tags/v1.1

哀由 2024-12-16 06:18:36

您可以使用 svn rm http://repo/path/to/tag 删除标签。这会将它们从 HEAD 中删除,但显然它们仍然在历史中,并且可以在需要时检索。之后,您的 svn up 将不再检索旧标签,并将从其工作副本中删除已删除的标签。

另一种可能的解决方案是使用一个“移动标签”,例如 tags/CURRENT,它始终指向最新的标签。您的发布过程将执行 svn cp new-prod-tag http://repo/tags/CURRENT。然后您的服务器只需要签出并更新当前标签,而不是所有标签。 免责声明:鼓励使用 SVN 进行这种做法,但我想将其作为潜在的解决方案扔掉。

You can delete the tags using svn rm http://repo/path/to/tag. This removes them from HEAD, but obviously they are still in history and can be retrieved if needed. After that, your svn up will no longer retrieve old tags and will remove the deleted ones from its working copy.

Another possible solution is to have a "moving tag", such as tags/CURRENT, that always points to the latest tag. Your release process would do an svn cp new-prod-tag http://repo/tags/CURRENT. Then your server would only need to checkout and update that CURRENT tag, instead of all the tags. DISCLAIMER: This is not an encouraged practice with SVN, but I wanted to throw it out there as a potential solution.

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