开发者

SVN changing location of repository

开发者 https://www.devze.com 2023-03-25 04:41 出处:网络
Here\'s my problem: I created three separate repos under one project. The repos are \"branches\" and \"trunk\" and \"tags\".

Here's my problem: I created three separate repos under one project. The repos are "branches" and "trunk" and "tags".

So I know I needed to delete them and have a single repository. I needed to move everything under trunk to the project. So I tried to do this remotely. First I checked out the project and then I deleted "branches" and "tags", both of which were empty.

I did a svn delete and then commit. Next I wanted to get rid of trunk, but it already held files. So what I did was I copied those files into the directory above it:

cp -r trunk/* . 

Now I deleted the trunk:

svn delete trunk/

Okay, so now the project is empty after I did the commit. But I still have those important files that I copied out of the trunk. I want to put them under the project on the remote server, so I would have only one repository hold开发者_开发问答ing those files. But those local files still think they belong under the trunk repository, which was deleted. So I then issued this command, which I hoped would fix them:

svn switch --relocate \
svn+ssh://fkim@.../home/fkim/svn/aetv/trunk \
svn+ssh://fkim@.../home/fkim/svn/aetv 

But this did not change anything with those files. When I do svn status, I see that they have the '?' next to them and if I try to add them, I am told that they are already under version control. What should I do? I need to get them all under the project on the remote server.

Please note that I am running everything on Linux. This is work I am doing at the command-line.


relocate is used to make a working copy point to another URL, which also holds the repo of this working copy (i.e. when the SVN server changes and you don't want to remove the working copy and check it out again).

You seem to want to reimport new files into an empty repo. Except your new files are still "marked" as being part of a working copy.

First checkout the empty trunk dir. This will create an empty working copy. The copy the old working copy to the new one, but remove all the .svn directories. This can be done using the export command. The add all the files and commit to import them into the repo.


It is extremely dangerous to modify folders structure (which are under SVN control) manually.

Now you have to do next steps:

  1. Checkout your current project again (don't copy anything inside it!)

    svn co http://your/project/svn/
    
  2. Restore the trunk:

    svn merge -rHEAD:PREV .
    svn ci -m "Trunk restored"
    
  3. Move the trunk contents:

    svn mv trunk/* .
    svn ci -m "Trunk contents moved up"
    
  4. Delete the trunk:

    svn del trunk
    svn ci -m "Trunk deleted"
    


On your local working folder, use TortoiseSVN select "Export" to trim all the svn stuff. Then commit your local folder to another repository. Can this solve your problem?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号