How to revert a subversion import?

别说谁变了你拦得住时间么 提交于 2019-12-24 11:14:37

问题


I did a mistake importing in an import to some SubVersion repository, and I want to revert this import.

How can I do that?

My mistake was this: Given a folder with subfolders

a \
a \ a1
a \ b1
a \ c1

I wanted to import the folder a inside a repository folder F, so the structure in the repository be

F\a

but I imported the folders a1, b1 and c1 and the repository now is

F \ a1
F \ b1
F \ c1

I'm using Tortoise Svn, so if your instructions are in terms of that, are better.


回答1:


svn mkdir repo-base/a
svn mv repo-base/a1 repo-base/a/
svn mv repo-base/b1 repo-base/a/
svn mv repo-base/c1 repo-base/a/

where repo-base is e.g. https://svn.my.net/svn/project/trunk/

then, when you're done, check it out locally.

renaming files and moving whole directories is most reliably achieved by issuing the commands against remote paths in my experience.




回答2:


Is this the first import for the repository? Just nuke, recreate, and re-import (but do it this time).

If you were importing the tree into something other than a brand new repository, you'll have to do a bit more.




回答3:


I see three choices. Using a GUI like TortoiseSVN could make things easier.

  1. Fix it where you're at

    Move the folders

  2. Delete repository and try again

    Create the repository

  3. Revert change and try again

    See Revert to this revision



来源:https://stackoverflow.com/questions/1424449/how-to-revert-a-subversion-import

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