SVN creating trunk directory on existing repository

前端 未结 6 1536
暗喜
暗喜 2020-12-23 21:43

I am working a project that does not have a trunk / branches / tags directory structure - ie. everything is in the root of the svn repo.

I would like to create a tru

相关标签:
6条回答
  • 2020-12-23 21:54

    Here give the way of using svn+ssh method to create the trunk folder in the svn root in unix terminal. "projectname" is the root "Identifier" when you create the project in svn:

    svn mkdir svn+ssh://username@host/projectname/trunk -m "Create the trunk folder"
    
    0 讨论(0)
  • 2020-12-23 21:54

    Old post but I too had the same issue with all my repos were in the root and not in trunks. This presented a problem when trying a simple git svn clone command. After hours of trial and error, it was a simple:

    git svn clone --username byname http://www.MySVNserver.com:81/repos/project1 --no-metadata --trunk=.

    0 讨论(0)
  • 2020-12-23 21:55

    You may want to look into the svnadmin tool.

    • http://svnbook.red-bean.com/en/1.0/ch09s02.html

    To be honest I have not tried this before, and you'll probably get an answer from someone who has, but you can work from something like this:

    • http://www.digitalmediaminute.com/article/2251/how-to-move-a-subversion-repository

    You should be able to init a new repository, create a 'trunk' directory in it, then dump your previous repository into the 'trunk'.

    0 讨论(0)
  • 2020-12-23 21:56

    This is similar to the way I've done it in the past. Your solution actually copies each file, then deletes the original. Because of the way Subversion implements copies, the history for every file is preserved.

    After doing this, you can point existing checkouts at the new location using svn switch.

    0 讨论(0)
  • 2020-12-23 21:56

    If you are using eclipse IDE and Subclipse for SVN then you can go ahead and create folders in SVN and move all the files/dir from root to the trunk directory and then checkout the ProjectName/trunk to you eclipse workspace...

    0 讨论(0)
  • 2020-12-23 22:09

    I had exactly the same problem and solved it after looking through several different pages (this one included). Here's my solution:

    Note: Before you begin, if you plan to use svn switch to keep your working copy and avoid checking out the repo again, it's best to make sure your working copy is up to date and has no uncommitted changes.

    On with the solution...

    //REPO_URL = The URL for the repo on the SVN server.
    //In my case it was https://IP_ADDRESS:PORT/svn/my_repo
    
    //Make the trunk dir in the root of your SVN repo
    svn mkdir REPO_URL/trunk -m "making trunk dir"
    
    //Move everything from your root dir to your new trunk dir
    svn move REPO_URL/A_FOLDER REPO_URL/trunk/A_FOLDER -m "moving folders to trunk"
    svn move REPO_URL/ANOTHER_FOLDER REPO_URL/trunk/ANOTHER_FOLDER -m "blah"
    svn move REPO_URL/A_FILE.TXT REPO_URL/trunk/A_FILE.TXT -m "moving files to trunk"
    //Keep going until you've moved everything from your root dir to the trunk dir...
    

    So now, on your SVN server, everything is in the trunk folder. Sweet!

    But my repo is 60GB and on a remote server. I'd rather not check that out again. svn switch will let you point your existing working copy to the new trunk dir so you can continue to work with the copy you have. Go into the root folder of your working copy and run svn switch REPO_URL/trunk --ignore-ancestry. It should say At revision X where X is the revision after you moved all of your files from the root directory into the trunk directory. That's it! Maybe do an SVN update for good measure :)

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