svn 目录建立

因为项目原因,需要为主干建立一个分支,以便于新功能开发而不影响原有的功能。

一、登录代码服务器,打开控制台窗口。

二、建立分支路径。
svn mkdir svn://mysite.com/branches
svn mkdir svn://mysite.com/branches/webapp
svn mkdir svn://mysite.com/branches/webapp/v1

三、建立分支。
svn copy svn://mysite.com/trunk/webapp/project svn://mysite.com/branches/webapp/v1

四、分支已经建立,访问地址为
svn://mysite.com/branches/webapp/v1/project

需要注意的是,文件路径只能一级一级的新建,而不能一次建立全路径。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Java中,可以使用SVNKit库来实现创建SVN目录SVNKit是一个开源的Java库,提供了与Subversion版本控制系统进行交互的API。 以下是使用SVNKit库创建SVN目录的示例代码: ```java import org.tmatesoft.svn.core.SVNCommitInfo; import org.tmatesoft.svn.core.SVNException; import org.tmatesoft.svn.core.SVNURL; import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory; import org.tmatesoft.svn.core.io.SVNRepository; import org.tmatesoft.svn.core.io.SVNRepositoryFactory; import org.tmatesoft.svn.core.wc.*; public class SVNCreateDirectoryExample { public static void main(String[] args) { // 初始化SVN库 DAVRepositoryFactory.setup(); // 定义SVN仓库的URL String url = "http://svn.example.com/svn/repository"; // 定义SVN仓库的认证信息 String username = "your_username"; String password = "your_password"; // 创建SVN目录路径 String directoryPath = "/path/to/new_directory"; try { // 创建SVN仓库的连接 SVNURL svnUrl = SVNURL.parseURIEncoded(url); SVNRepository repository = SVNRepositoryFactory.create(svnUrl); // 设置SVN仓库的认证信息 ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(username, password); repository.setAuthenticationManager(authManager); // 创建SVN目录 SVNClientManager clientManager = SVNClientManager.newInstance(); SVNWCClient wcClient = clientManager.getWCClient(); SVNCommitInfo commitInfo = wcClient.doMkDir(new SVNURL[]{svnUrl.appendPath(directoryPath, false)}, "Create new directory"); // 输出创建目录的结果 System.out.println("Directory created: " + commitInfo.getNewRevision()); } catch (SVNException e) { e.printStackTrace(); } } } ``` 请注意,上述示例代码中的`url`、`username`、`password`和`directoryPath`需要根据实际情况进行修改。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值