版本管理之SVN实践教程:基础篇(5):提交/解决冲突/回退/确认

本文详细阐述了SVN中冲突产生的原因,通过模拟多人协作场景展示了如何处理冲突。从devuser1和devuser2的并发修改到解决冲突、回退操作,再到防止冲突的策略,为团队开发提供了实用的SVN冲突解决经验。
摘要由CSDN通过智能技术生成

这里写图片描述
这篇文章介绍一下团队开发时经常会碰到的svn的冲突产生的原因以及回退或者解决冲突的方式。

冲突产生的原因

多个团队开发成员对同一文件进行了互斥性的修改经常是冲突产生的原因,比如两个开发成员对同一个文件的同一行进行了不同的修改,这种情况就会导致冲突的产生。

模拟冲突

使用如下方式模拟项目中实际的冲突

开发用户 分支 修改文件 修改内容
devuser1 trunk feature_script.sh 添加added by devuser1
devuser2 trunk feature_script.sh 添加added by devuser2

devuser1和devuser2同时checkout

devuser1:

[root@platform trunk]# ls
feature_script.sh  trunk-file
[root@platform trunk]#

devuser2:

[root@platform test]# svn co svn://192.168.163.129:3690/demo-repo/trunk --username devuser2 --password devuser2pw

-----------------------------------------------------------------------
ATTENTION!  Your password for authentication realm:

   <svn://192.168.163.129:3690> 4fdba69f-3632-49f7-b5ba-d0491223c588

can only be stored to disk unencrypted!  You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible.  See the documentation for details.

You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/root/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? yes
A    trunk/feature_script.sh
A    trunk/trunk-file
 U   trunk
Checked out revision 8.
[root@platform test]# cd trunk/
[root@platform trunk]# ls
feature_script.sh  trunk-file
[root@platform trunk]# cat feature_script.sh 
[root@platform trunk]#

devuser1进行修改并提交

[root@platform trunk]# ls
fea
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值