SVN的switch命令

来源:互联网 发布:淘宝严重违规包括那些 编辑:程序博客网 时间:2024/04/29 11:10
语法就不说了,文档有的是,主要是两个常用的用法:1. 切换资源库(svn sw --relocate)[plain] view plaincopysvn sw --relocate <from_url> <to_url> [PATH]  例子:[plain] view plaincopysvn sw --relocate https://mysvn.cn/svn/old https://mysvn.cn/svn/new .  (注意最后有个点“.”,代表当前目录,其实可以不打,不打默认表示当前目录)这个意思就是说从https://mysvn.cn/svn/old这个资源库切换到https://mysvn.cn/svn/new。注意,这里有且只有可以切换资源库,而不是切换分支!什么是资源库呢?敲“svn info”看到“Repository Root”就是喇,用--relocate的时候就只能切换这段,要不然会提示错误的。2. 切换分支(svn sw)[plain] view plaincopysvn sw <branch_full_url>  例子:[plain] view plaincopysvn sw https://mysvn.cn/svn/repo/project/branches/version-xxx  同上面例子类似,后面点省略了。这样就能来回切换分支。但是这样有时候在某些软件checkout下来的working copy上会提示资源库不正确,解决办法如下:照样是svn info看看信息,有时候“Repository Root”是这样的格式“https://username@mysvn.cn/svn/repo”这个时候有两种办法一是使用“svn sw https://username@mysvn.cn/svn/repo/project/branches/version-xxx”切换二是先通过"svn sw --relocate https://username@mysvn.cn/svn/repo https://mysvn.cn/svn/repo“来切换资源库,然后再切换分支

 

0 0