eKek0
eKek0

Reputation: 23319

How to revert a subversion import?

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.

Upvotes: 1

Views: 3199

Answers (3)

TJR
TJR

Reputation: 3773

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

Upvotes: 0

Jonathan Graehl
Jonathan Graehl

Reputation: 9301

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.

Upvotes: 3

timdev
timdev

Reputation: 62914

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.

Upvotes: 0

Related Questions