在 SVN 中删除最近的提交 [英] Deleting recent commits in SVN

查看:119
本文介绍了在 SVN 中删除最近的提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我还是习惯了这个 SVN 业务.我基本上在新年前后在我的存储库中进行了转储.我认为重组我网站的代码库以准备实施一些 OOP 更改是个好主意.唯一的问题是,我愚蠢地直接在我的电脑"中而不是通过我的 IDE 执行此操作.下一次提交是 FUBAR……所以我一次又一次地提交……嗯,是的,基本上只是在我的存储库中进行了转储.

Ok, so I'm still getting used to this SVN business. I basically took a dump in my repository right around New Years. I thought it would be a good idea to restructure my website's codebase in preparation for implementing some OOP changes. The only problem was, in my foolishness, I did this directly in My Computer rather than through my IDE. The next commit was FUBAR... so I committed again, and again.. and well, yeah basically just took a dump in my repository.

因此,在将我的存储库击败到 NetBeans 完全无法解析的纸浆状状态后,我转向 TortoiseSVN 深入挖掘并检查我最后一次理智的提交.这大约是链中较早的 5 次提交.

SO, having beaten my repository to a pulp-like state utterly unparsable by NetBeans, I turned to TortoiseSVN to dig down to and check-out my last sane commit. That was about 5 commits earlier in the chain.

我正在下载那个.我想知道我如何才能消除在此之后的所有提交,并假装整个系列的愚蠢行为从未发生过.

I'm currently downloading that. And I'm wondering how I can nuke all the commits that came after this one and pretend that whole series of idiocy just never happened.

感谢您提供的任何帮助.如果重要的话,我在 SlikSVN 托管.(我怀疑它没有...)

Thanks for any help you can provide. I'm hosted at SlikSVN if it matters. (I suspect it does not...)

推荐答案

如果你真的想从服务器上删除历史记录直到给定的修订,我会创建一个新的存储库和 svnsync 直到修订版没问题.然后将 uuid 文件复制到新存储库(以获得匹配的 uuid),然后将您的工作副本重新定位到新存储库 - 更新后(是的,这就是乌龟 GUI 中的调用方式!)新的存储库.

If you really want to erase the history from the server up to a given revision, I would create a new fresh repository and svnsync to it up to the revision that was ok. Then copy the uuid file to the new repository (to have a matching uuid) and then relocate your working copy to the new repository - AFTER having updated (yes that's how it's called in the tortoise GUI!) to the older revision that is present in the new repository.

一个乏味的替代方法是进行完全转储,最后删除不需要的修订版,然后重新加载.但请注意转储必须保持一致.删除中间的修订可能会导致麻烦.

A tedious alternative is to take a full dump, delete the revisions you don't need at the end and load it again. But take care that the dump must remain consistent. Deleting revisions in-between might cause trouble.

这篇关于在 SVN 中删除最近的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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