如何在SVN中创建分支?
当前回答
如果你的repo是通过https可用的,你可以使用这个命令来分支…
svn copy https://host.example.com/repos/project/trunk \
https://host.example.com/repos/project/branches/branch-name \
-m "Creating a branch of project"
其他回答
如果你的repo是通过https可用的,你可以使用这个命令来分支…
svn copy https://host.example.com/repos/project/trunk \
https://host.example.com/repos/project/branches/branch-name \
-m "Creating a branch of project"
使用svn copy命令新建分支,如下所示:
$ 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"
SVN新用户的小贴士;这可能有助于快速获得正确的url。
执行svn info命令显示当前签出分支的有用信息。
URL应该(如果您在根文件夹中运行svn)提供您需要从中复制的URL。
也可以使用svn switch命令切换到新创建的分支:
svn switch http://my.repo.url/myrepo/branches/newBranchName
通常您会将它复制到svn+ssh://host.example.com/repos/project/branches/mybranch,这样您就可以在存储库中保留几个分支,但是您的语法是有效的。
下面是一些关于如何设置存储库布局的建议。
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. :)
推荐文章
- 提交前将文件“unadd”到SVN
- 跟踪所有远程git分支作为本地分支
- 为什么要把Gradle Wrapper提交给VCS?
- 自定义SSH端口上的Git
- 如何查看最近的SVN日志条目?
- Mercurial:我可以重命名分支吗?
- 如何丢弃SVN签出中的本地更改?
- Git克隆/拉不断冻结在“存储密钥在缓存?”
- 如何使用Git向远程存储库进行初始推送?
- 从pull请求中删除一个修改过的文件
- 从SVN存储库中删除文件而不删除本地副本
- 如何移动文件?
- 什么原因导致SVN错误“Not a working copy”?
- 我如何从现有回购的分支创建一个新的GitHub回购?
- 如何将Git分支移到它自己的存储库中?