Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move svn folder one level up

I need to move svn folder to one level up and keep all history

All files and directories from https://myserver.com/svn/Project/trunk/ into https://myserver/svn/Project/

I use a command:

svn move https://myserver.com/svn/Project/trunk/ https://myserver/svn/Project/

but it says:

svn: Cannot move path 'https://myserver.com/svn/Project/trunk/' into itself

Who knows how can I resolve that problem? Thanks!

like image 558
ihorko Avatar asked Sep 09 '10 18:09

ihorko


People also ask

How do I clean up a .svn folder?

According to this answer and SVN change log, svn cleanup has an option to vacuum pristine copies ( /vacuum ). This is done by default starting from 1.8. From version 1.10 up it is not longer done by default, but can be run using the command svn cleanup --vacuum-pristines (see this answer).


5 Answers

I was just looking for this as well. Then I started looking for a solution and I didn't really find one, except that it did make me think of a solution.

You'd expect the command svn mv ./folder ./ to move everything from the ./folder to ./. This isn't actually true, it'll move folder into the current directory. Since this is where it already is, the command fails.

So, the solution would be to move everything inside ./folder to ./. Indeed, the following command does just that:

svn mv ./folder/* ./

like image 88
Joost Avatar answered Oct 11 '22 02:10

Joost


If you are willing to use TortoiseSVN then you can simply move the folder with the repository browser. That is how I usually move folders around, very simple and painless.

like image 23
Stefan Egli Avatar answered Oct 11 '22 02:10

Stefan Egli


I don;t know if you can move it that way, personally I would checkout repository, move folder in filesystem and then commit changes, deleting it at one location and adding at another.

like image 41
Tomasz Kowalczyk Avatar answered Oct 11 '22 01:10

Tomasz Kowalczyk


Try:

svn switch --relocate https://myserver.com/svn/Project/trunk/ https://myserver/svn/Project/

Please test this in a seperate repository before you run it on your real one!

like image 27
Nix Avatar answered Oct 11 '22 01:10

Nix


I ran into a similar issue today but I didn't know how to move it up from tortoise, since I also had settings for that folder.

If the new location https://myserver/svn/Project/ should have only the items from your old location, here is what I did:

  • Moved https://myserver.com/svn/Project/trunk/ to a new temporary location (e.g. https://myserver/svn/TempProject/);

  • Deleted the existing location you want to use (https://myserver/svn/Project/);

  • Renamed https://myserver/svn/TempProject/ to https://myserver/svn/Project/.

This worked for me. It preserved all history, svn settings, etc. The history just got a couple new entries from all the moving around thing.

like image 26
fasfsfgs Avatar answered Oct 11 '22 00:10

fasfsfgs