Mac下 svn 的分支管理

背景

对项目启新版版本,在原来基础上创建一个分支。
由于在 mac 没有好的图形界面,只能选择 命令行 模式

操作

创建新分支

svn cp -m "我的新分支" https://tianya@192.168.5.18/svn/mytest/iosApp/Glaucus https://tianya@192.168.5.18/svn/mytest/iosApp/xGlaucus 

在任何目录下都进行这条命令,因为与本地工作目录没有任何联系

这条命令执行后,会有这样的提示:

Error validating server certificate for 'https://192.168.5.18:443':
 - The certificate is not issued by a trusted authority. Use the
   fingerprint to validate the certificate manually!
 - The certificate hostname does not match.
Certificate information:
 - Hostname: WIN-J77129UK1OK
 - Valid: from Jan 23 12:33:50 2015 GMT until Jan 20 12:33:50 2025 GMT
 - Issuer: WIN-J77129UK1OK
 - Fingerprint: 17:72:80:FB:21:4E:CC:53:2D:61:38:A5:DC:C3:A6:39:26:D3:3F:3C
(R)eject, accept (t)emporarily or accept (p)ermanently? p
Authentication realm: <https://192.168.5.18:443> VisualSVN Server
Password for 'tianya': 

不要恐惧,其实就是输入密码就好了。

输入密码正确后,分支就创建好了。

checkout 到工作目录

svn co  https://tianya@192.168.5.18/svn/mytest/iosApp/xGlaucus 

不需要工作目录下执行就行,不需要建对应的文件夹

然后打开项目就可以用了

项目编译执行后发现了一个问题,之前主干上的代码并不是最新的,怎么办呢?

先到主干的工作目录下,将代码全部提交,

然后怎么更新到分支呢?难道要重新创建分支吗?不是,可以从主干合并到分支

从主干合并到分支

切换到分支目录下:

 ~iosApp cd xGlaucus 

执行;

svn merge https://tianya@192.168.5.18/svn/mytest/iosApp/Glaucus

冲突合并提示:

Summary of conflicts:
 Text conflicts: 1
Conflict discovered in file 'Glaucus/Managers/SKYConfig.h'.
Select: (p) postpone, (df) show diff, (e) edit file, (m) merge,
       (mc) my side of conflict, (tc) their side of conflict,
       (s) show all options: tc
Resolved conflicted state of 'Glaucus/Managers/SKYConfig.h'
Summary of conflicts:
 Text conflicts: 0 remaining (and 1 already resolved)

我选择了 tc.

合并完毕,进入目录打开,是最新代码,编译正常。

合并分支到主干

和从主干到分支一样简单

进入主干的工作目录 执行命令

svn merge --reintegrate https://tianya@192.168.5.18/svn/mytest/iosApp/xGlaucus

关于冲突和提示和 从主干到分支 一样,那就一样处理就行了。

总结

其实很简单,这些操作同样适合在 windows ,因为命令是一样的。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值