Force old revision to be the newest revision - SVN

安稳与你 提交于 2019-12-24 00:57:19

问题


I have an old revision which works fantastic and I'd like to reverse the past few revisions I've made in SVN. How can I simply remove those revisions and make the HEAD be a specific revision. That way, when I press update, it goes to that revision, and not the real current reivision?


回答1:


From the svn book:

Undoing Changes

Another common use for svn merge is to roll back a change that has already been committed. Suppose you're working away happily on a working copy of /calc/trunk, and you discover that the change made way back in revision 303, which changed integer.c, is completely wrong. It never should have been committed. You can use svn merge to “undo” the change in your working copy, and then commit the local modification to the repository. All you need to do is to specify a reverse difference:

$ svn merge -r 303:302 http://svn.example.com/repos/calc/trunk
U  integer.c

$ svn status
M  integer.c

$ svn diff
…
# verify that the change is removed
…

$ svn commit -m "Undoing change committed in r303."
Sending        integer.c
Transmitting file data .
Committed revision 350.

For more details, see the rest of the "Undoing Changes" section.




回答2:


If you do an SVN HELP MERGE, look at the 3rd form shown (-r N:M). I believe this is the method you want to use.



来源:https://stackoverflow.com/questions/13885640/force-old-revision-to-be-the-newest-revision-svn

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