Deleting recent commits in SVN

﹥>﹥吖頭↗ 提交于 2019-12-11 14:59:50

问题


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.

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.

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


回答1:


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.




回答2:


Take a look at this TortoiseSVN help topic: Roll back (Undo) revisions in the repository.

Currently there is no way to easily remove revisions permanently from the revision history, although SVN might one day grow this feature.



来源:https://stackoverflow.com/questions/4668843/deleting-recent-commits-in-svn

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!