SVN Revert Trunk,删除修订版本,就好像它从未存在过一样?
是否可以在 svn 服务器中删除修订版,就好像它从未存在过一样?
所以我们有以下修改:
1004 // Commit of some bogus code that broke the build and was just wrong
1003 // Change 1.2
1002 // Change 1.1
1001
1000 *** Initial checkin
我们可以删除svn中的1004并恢复到1003,就好像1004从未存在过一样吗?
原谅我的无知,我还在学习如何使用SVN。
Is it possible in the svn server to remove a revision as if it never existed?
So we have the following revisions:
1004 // Commit of some bogus code that broke the build and was just wrong
1003 // Change 1.2
1002 // Change 1.1
1001
1000 *** Initial checkin
Can we we remove the 1004 in svn and revert back to 1003 as if 1004 never existed?
Forgive my ignorance, I'm still learning how to use SVN.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
这些事故时有发生,如果 SVN 将它们保留在历史记录中,那就不是问题了。重要的是修复事故。执行此操作的方法是恢复此提交所做的更改。使用以下命令:
如果您使用 TortoiseSVN,您可以只显示日志,选择提交,然后在上下文菜单中选择“恢复此版本的更改”。它将把您的工作副本更改为以前的版本,您只需提交即可。
我想其他图形客户端也有相同的选项。
These accidents hapen, and it's not a problem if SVN keeps them in its history. What is important is to fix the accident. The way to do it is to revert the changes made by this commit. use the following commands:
If you're using TortoiseSVN, you could just show the logs, select the commit, and choose "Revert changes from this revision" in the context menu. It will change your working copy to the previous version, and you'll just have to commit.
I guess other graphical clients have the same option.
VCS 系统经过专门设计,使这一过程尽可能复杂。您通常不想这样做。
话虽如此,从官方文档来看:
http://subversion.apache.org/faq.html#removal
VCS systems are designed specifically to make this as complicated as possible. You usually do not want to do this.
That being said, from the official documentation:
http://subversion.apache.org/faq.html#removal
您可以将主干移动到另一个分支(备份)并将正确的修订版本复制回主干
请注意,修订版本号将增加,并且所有更改都将显示在 svn 日志中。
You can move the trunk to another branch (backup) and copy the correct revision back to trunk
Please note the revision number will increment and all changes will be displayed in svn log.
您可以创建当前存储库的转储并跳过转储中的虚假修订。然后,您可以将转储加载到同一服务器或不同服务器上的新存储库。
You can create a dump of the current repository and skip the bogus Revision in the dump. You can then load the dump to a new repository on the same server or on a different one.
如果您没有真正的理由(例如空间不足)删除它,我建议您保留该修订版。这是 SVN 服务器的主要工作,保存更改。
I recommend leaving the revision if you don't have a real reason (Shortage in space for example) to remove it. This is the main job of the SVN server, to keeps changes.