How do I create a branch?

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

How do I create a branch in SVN?

相关标签:
10条回答
  • 2020-12-02 04:08

    Branching in Subversion is facilitated by a very very light and efficient copying facility.

    Branching and tagging are effectively the same. Just copy a whole folder in the repository to somewhere else in the repository using the svn copy command.

    Basically this means that it is by convention what copying a folder means - whether it be a backup, tag, branch or whatever. Depending upon how you want to think about things (normally depending upon which SCM tool you have used in the past) you need to set up a folder structure within your repository to support your style.

    Common styles are to have a bunch of folders at the top of your repository called tags, branches, trunk, etc. - that allows you to copy your whole trunk (or sub-sets) into the tags and/or branches folders. If you have more than one project you might want to replicate this kind of structure under each project:

    It can take a while to get used to the concept - but it works - just make sure you (and your team) are clear on the conventions that you are going to use. It is also a good idea to have a good naming convention - something that tells you why the branch/tag was made and whether it is still appropriate - consider ways of archiving branches that are obsolete.

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

    Create a new branch using the svn copy command as follows:

    $ svn copy svn+ssh://host.example.com/repos/project/trunk \
               svn+ssh://host.example.com/repos/project/branches/NAME_OF_BRANCH \
          -m "Creating a branch of project"
    
    0 讨论(0)
  • 2020-12-02 04:10

    If you even plan on merging your branch, I highly suggest you look at this:

    Svnmerge.py

    I hear Subversion 1.5 builds more of the merge tracking in, I have no experience with that. My project is on 1.4.x and svnmerge.py is a life saver!

    0 讨论(0)
  • 2020-12-02 04:13
    • Create a new folder outside of your current project. You can give it any name. (Example: You have a checkout for a project named "Customization". And it has many projects, like "Project1", "Project2"....And you want to create a branch of "Project1". So first open the "Customization", right click and create a new folder and give it a name, "Project1Branch").
    • Right click on "Myproject1"....TortoiseSVN -> Branch/Tag.
    • Choose working copy.
    • Open browser....Just right of parallel on "To URL".
    • Select customization.....right click then Add Folder. and go through the folder which you have created. Here it is "Project1Branch". Now clik the OK button to add.
    • Take checkout of this new banch.
    • Again go to your project which branch you want to create. Right click TorotoiseSVN -> branch/tag. Then select working copy. And you can give the URL as your branch name. like {your IP address/svn/AAAA/Customization/Project1Branch}. And you can set the name in the URL so it will create the folder with this name only. Like {Your IP address/svn/AAAA/Customization/Project1Branch/MyProject1Branch}.
    • Press the OK button. Now you can see the logs in ...your working copy will be stored in your branch.
    • Now you can take a check out...and let you enjoy your work. :)
    0 讨论(0)
提交回复
热议问题