How do I create a branch?

后端 未结 10 1034
梦谈多话
梦谈多话 2020-12-02 03:24

How do I create a branch in SVN?

相关标签:
10条回答
  • Normally you'd copy it to svn+ssh://host.example.com/repos/project/branches/mybranch so that you can keep several branches in the repository, but your syntax is valid.

    Here's some advice on how to set up your repository layout.

    0 讨论(0)
  • 2020-12-02 04:00

    If you're repo is available via https, you can use this command to branch ...

    svn copy https://host.example.com/repos/project/trunk \
           https://host.example.com/repos/project/branches/branch-name \
      -m "Creating a branch of project"
    
    0 讨论(0)
  • 2020-12-02 04:00
    svn cp /trunk/ /branch/NEW_Branch
    

    If you have some local changes in trunk then use Rsync to sync changes

    rsync -r -v -p --exclude ".svn" /trunk/ /branch/NEW_Branch
    
    0 讨论(0)
  • 2020-12-02 04:03

    Suppose you want to create a branch from a trunk name (as "TEST") then use:

    svn cp -m "CREATE BRANCH TEST" $svn_url/trunk $svn_url/branches/TEST
    
    0 讨论(0)
  • 2020-12-02 04:03

    Below are the steps to create a branch from trunk using TortoiseSVN in windows machine. This obviously needs TortoiseSVN client to be installed.

    1. Right Click on updated trunk from local windows machine
    2. Select TortoiseSVN
    3. Click branch/Tag
    4. Select the To path in SVN repository. Note that destination URL is updated according to the path and branch name given
    5. Do not create folder inside branches in repository browser
    6. Add branches path. For example, branches/
    7. Add a meaningful log message for your reference
    8. Click Ok, this creates new folder on local system
    9. Checkout the branch created into new folder
    0 讨论(0)
  • 2020-12-02 04:04

    Top tip for new SVN users; this may help a little with getting the correct URLs quickly.

    Run svn info to display useful information about the current checked-out branch.

    The URL should (if you run svn in the root folder) give you the URL you need to copy from.

    Also to switch to the newly created branch, use the svn switch command:

    svn switch http://my.repo.url/myrepo/branches/newBranchName
    
    0 讨论(0)
提交回复
热议问题