我可以在 Subversion 中删除提交吗?
每次意外我犯了两次,因为我忘记添加两个文件。我可以从日志中删除特定的提交吗?
我想删除第 4 号提交。
Per accident I committed twice because I forgot to add two files. Can I remove a specific commit from the log?
I want to delete commit № 4.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
简单的答案是“否”,因为 Subversion 不知道如何解决当您添加提交、其他人更新其签出,然后您从历史记录中删除提交时的情况。可能有也可能没有涉及 Subversion 存储手术的复杂答案。
The simple answer is "no", because Subversion doesn't know how to resolve the case when you add a commit, someone else updates their checkout, and then you remove the commit from history. There might or might not be a complex answer involving surgery on the Subversion storage.
无权删除/创建存储库 - 你无能为力。
如果您可以删除当前的存储库并使用新的历史记录创建新的存储库,您可以尝试:
svnadmin dump
以获得人类可读的(我不得不说)存储库转储、grok 格式和编辑转储、删除存储库、
svnadmin load
重新创建存储库的
SCM,它有一个通往SVN的桥梁(hg+MQ(histedit)+hg-git,fe,将
允许您获取存储库并折叠/删除变更集)。用于更换
旧存储库 - 参见上面第 2 页
haven't rights delete/create repo - you can't do anything.
If you can delete current repo and create new with new history, you can try:
svnadmin dump
for getting human-readable (barely, I have to say)repository-dump, grok format and edit dump, delete repo,
svnadmin load
to recreate the repo
SCM, which has a bridge to SVN (hg+MQ (histedit)+hg-git, f.e, will
allow you to get repo and fold/delete changesets). For replacing
old repository - see p.2 above
在您的情况下,只需修改与提交 #4 关联的提交注释即可反映您所做的实际更改。您可以通过修改 SVN 存储库配置来使用 Subversion 来实现此目的。请参阅 Subversion 常见问题解答。
In your case, it's just necessary to modify the commit comment associated with commit #4 to reflect the actual changes you made. You can do that with Subversion by modifying the SVN repository configuration. See the Subversion FAQ.
对于任何真正尝试执行此操作并且您对文件系统具有写访问权限的人来说,存储库位于此,如果它是当前的最后一次提交,则此过程有效:
其中 ### 是修订版的前几个数字,而 ##### # 是完整的转速。
For anyone actually trying to do this and you have write access to the filesystem the repo is on this is the procedure that works IF it's the current last commit:
Where ### is the first few numbers of the revision and ###### is the full rev number.
为什么?让 Subversion 保留历史——这就是它的目的。尽早且经常入住。无需删除提交 #4。
Why? Let Subversion keep the history - that's what it's for. Check in early and often. There's no need to erase commit #4.