Is there a clean way to move / to /trunk?

后端 未结 9 1636
感动是毒
感动是毒 2020-12-23 17:34

I made the mistake of creating a Subversion repository without the usual trunk, branches, and tags directories. That is, the root dire

相关标签:
9条回答
  • 2020-12-23 18:08

    As the other answers point out, just doing a svn mv into the trunk directory will do this. To then update your working copy, check out the svn switch command.

    0 讨论(0)
  • 2020-12-23 18:14

    Can’t you just create the trunk dir and move everything from / to trunk?

    0 讨论(0)
  • 2020-12-23 18:18

    Used therefromhere's answer, which worked fine, but wanted to add the commands including the parameters, i.e. as executed on the svn server's command line:

    1. Dump your existing repository into a file:

      svnadmin dump /path/to/myrepo/ > /some/dir/myproject.svndump
      
    2. Create a new repository:

      svnadmin create /path/to/mynewrepo/
      
    3. Add the trunk/ folder and commit it, in the working copy directory:

      mkdir trunk; svn add trunk; svn commit trunk -m "Add: trunk folder"
      
    4. Load the dumpfile into the new repository using trunk as parent-dir:

      svnadmin load --parent-dir trunk /path/to/mynewrepo/ < /some/dir/myproject.svndump
      
    0 讨论(0)
  • 2020-12-23 18:26

    Quick example of how I did it.

    I wanted to move file:///svn/myRepo to file:///svn/myRepo/trunk

    cd /  
    svnadmin dump /svn/myRepo > my.dump  
    killall svnserve  
    sudo rm -r -f /svn/myRepo  
    svnadmin create /svn/myRepo  
    svnserve -d -r /svn  
    svn mkdir file:///svn/myRepo/trunk -m "Created trunk dir"  
    svnadmin load /svn/myRepo --parent-dir trunk < my.dump
    
    0 讨论(0)
  • 2020-12-23 18:27

    The clean way to do this is using svnadmin to dump out the whole repository using

    svnadmin dump
    

    Then create a new repository with the trunk directory at the root, and reload the dump with

    svnadmin load --parent-dir trunk

    If you do an svn move then that will mess things up if you ever update back to a revision before the move, since the files will move back to their previous location, which is probably not what you want.

    0 讨论(0)
  • 2020-12-23 18:29

    You need to create /trunk and do an svn move of all contents of root inside the trunk and then commit.

    After that you'll switch your working copy to /trunk.

    0 讨论(0)
提交回复
热议问题