Roll back or revert entire svn repository to an older revision

前端 未结 14 1403
时光取名叫无心
时光取名叫无心 2020-12-04 06:53

I messed up on my SVN repository and now need to revert the entire repository from revision 28 to 24 and don\'t want to deal with diffs or conflicts. Is there a quick and si

14条回答
  •  半阙折子戏
    2020-12-04 07:30

    If you do not avail admin rights then you cannot obliterate any old revisions BUT you can still hide them extremely well with just one amazingly simple "svn copy" command (nickf and JesperE already mentioned this but in a rather cryptic way)

    svn delete protocol://svnserver/some/resource
    svn copy protocol://svnserver/some/resource@24 protocol://svnserver/some/resource

    And that's it, revisions 25 to 28 have completely disappeared from svn log. It's not a hack at all, it is a safe and (barely...) documented feature.

    If "resource" is a directory then you must strip it from the last URL:

    svn copy protocol://svnserver/some/directory@24 protocol://svnserver/some/

    (otherwise you would copy it inside itself)

提交回复
热议问题