一、SVN分支

Branch 选项会给开发者创建出另外一条线路。当有人希望开发进程分开成两条不同的线路时,这个选项会非常有用。

情景:

比如项目 demo 下有两个小组,svn 下有一个 trunk 版。

由于客户需求突然变化,导致项目需要做较大改动,此时项目组决定由小组 1 继续完成原来正进行到一半的工作(某个模块),小组 2 进行新需求的开发。

那么此时,我们就可以为小组2建立一个分支,分支其实就是 trunk 版(主干线)的一个copy版,不过分支也是具有版本控制功能的,而且是和主干线相互独立的,当然,到最后我们可以通过(合并)功能,将分支合并到 trunk 上来,从而最后合并为一个项目。

[root@localhost test]# ls
hello.html test01 test02 test03
[root@localhost test]# svn copy test02/ test04
A test04
[root@localhost test]# ls
hello.html test01 test02 test03 test04
[root@localhost test]# svn status
A + test04
[root@localhost test]# svn commit -m "add test04"
Authentication realm: <svn://192.168.1.69:3700> test
Password for 'admin': -----------------------------------------------------------------------
ATTENTION! Your password for authentication realm: <svn://192.168.1.69:3700> test 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)? no
Adding test04 Committed revision 6.
[root@localhost test]# ll test04/
total 4
-rw-r--r-- 1 root root 38 Feb 26 13:33 old.html
[root@localhost test04]# vim index.html
[root@localhost test04]# svn status
? index.html
[root@localhost test04]# svn add index.html
A index.html
[root@localhost test04]# svn commit -m "add index.html"
Authentication realm: <svn://192.168.1.69:3700> test
Password for 'admin': -----------------------------------------------------------------------
ATTENTION! Your password for authentication realm: <svn://192.168.1.69:3700> test 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)? no
Adding test04/index.html
Transmitting file data .
Committed revision 7.

切换到test02,执行svn update,然后将test04分支合并到test02中。

root@runoob:~/svn/runoob01/trunk# svn merge ../branches/my_branch/
--- Merging r10 into '.':
A index.html
--- Recording mergeinfo for merge of r10 into '.':
G . root@runoob:~/svn/runoob01/trunk# ll
total 16
drwxr-xr-x 2 root root 4096 Nov 7 03:52 ./
drwxr-xr-x 6 root root 4096 Jul 21 19:19 ../
-rw-r--r-- 1 root root 36 Nov 7 02:23 HelloWorld.html
-rw-r--r-- 1 root root 0 Nov 7 03:52 index.html
-rw-r--r-- 1 root root 22 Nov 7 03:06 readme root@runoob:~/svn/runoob01/trunk# svn commit -m "add index.html"
Adding index.html
Transmitting file data .
Committed revision 11.

二、SVN 标签(tag)

版本管理系统支持 tag 选项,通过使用 tag 的概念,我们可以给某一个具体版本的代码一个更加有意义的名字。

Tags 即标签主要用于项目开发中的里程碑,比如开发到一定阶段可以单独一个版本作为发布等,它往往代表一个可以固定的完整的版本,这跟 VSS 中的 Tag 大致相同。

[root@localhost test]# svn copy test04/ v1.0
A v1.0
[root@localhost test]# ls v1.0/
index.html old.html
[root@localhost test]# svn status
A + v1.0
[root@localhost test]# svn commit -m "tags v1.0"
Authentication realm: <svn://192.168.1.69:3700> test
Password for 'admin': -----------------------------------------------------------------------
ATTENTION! Your password for authentication realm: <svn://192.168.1.69:3700> test 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)? no
Adding v1.0
Adding v1.0/index.html Committed revision 8.

三、其他命令及用法

(1)resolve命令

解决版本冲突的命令。在冲突解决之后,需要使用svn resolved来告诉subversion冲突解决,这样才能提交更新。

(2)import命令(导入)

svn import Armatrue svn://192.168.0.249/svn/ninjiaSourceCode/trunk/Armatrue --username=xiaohuang --password=123456 -m "import new project"

(3)export命令(导出)

svn export -r 2232 svn://10.11.22.11/svn/project001

(4)文件锁

一般用于二进制内容,因为无法合并。

如果某个文件加锁,其他用户的本地工作拷贝(更新后)将是只读的。

当该用户提交后,其他用户的本地工作拷贝(更新后)才可以写操作。

其他用户可以“撬锁”,然后进行写操作。

高级配置可以配置“撬锁”权限,使不是什么人都可以“撬锁”。

四、SVN中的可用命令

   add
blame (praise, annotate, ann)
cat
changelist (cl)
checkout (co)
cleanup
commit (ci)
copy (cp)
delete (del, remove, rm)
diff (di)
export
help (?, h)
import
info
list (ls)
lock
log
merge
mergeinfo
mkdir
move (mv, rename, ren)
propdel (pdel, pd)
propedit (pedit, pe)
propget (pget, pg)
proplist (plist, pl)
propset (pset, ps)
resolve
resolved
revert
status (stat, st)
switch (sw)
unlock
update (up)

SVN使用—高级用法的更多相关文章

  1. Visual Studio 宏的高级用法

    因为自 Visual Studio 2012 开始,微软已经取消了对宏的支持,所以本篇文章所述内容只适用于 Visual Studio 2010 或更早期版本的 VS. 在上一篇中,我已经介绍了如何编 ...

  2. SolrNet高级用法(分页、Facet查询、任意分组)

    前言 如果你在系统中用到了Solr的话,那么肯定会碰到从Solr中反推数据的需求,基于数据库数据生产索引后,那么Solr索引的数据相对准确,在电商需求中经常会碰到菜单.导航分类(比如电脑.PC的话会有 ...

  3. sqlalchemy(二)高级用法

    sqlalchemy(二)高级用法 本文将介绍sqlalchemy的高级用法. 外键以及relationship 首先创建数据库,在这里一个user对应多个address,因此需要在address上增 ...

  4. Solr学习总结(六)SolrNet的高级用法(复杂查询,分页,高亮,Facet查询)

    上一篇,讲到了SolrNet的基本用法及CURD,这个算是SolrNet 的入门知识介绍吧,昨天写完之后,有朋友评论说,这些感觉都被写烂了.没错,这些基本的用法,在网上百度,资料肯定一大堆,有一些写的 ...

  5. 再谈Newtonsoft.Json高级用法

    上一篇Newtonsoft.Json高级用法发布以后收到挺多回复的,本篇将分享几点挺有用的知识点和最近项目中用到的一个新点进行说明,做为对上篇文章的补充. 阅读目录 动态改变属性序列化名称 枚举值序列 ...

  6. Jquery remove 高级用法

    Jquery remove 高级用法 html 代码 <div class="file-image">abc1111</div><div class= ...

  7. Newtonsoft.Json高级用法(转)

    手机端应用讲究速度快,体验好.刚好手头上的一个项目服务端接口有性能问题,需要进行优化.在接口多次修改中,实体添加了很多字段用于中间计算或者存储,然后最终用Newtonsoft.Json进行序列化返回数 ...

  8. redis(二)高级用法

    redis(二)高级用法 事务 redis的事务是一组命令的集合.事务同命令一样都是redis的最小执行单元,一个事务中的命令要么执行要么都不执行. 首先需要multi命令来开始事务,用exec命令来 ...

  9. 【转】 Newtonsoft.Json高级用法

    手机端应用讲究速度快,体验好.刚好手头上的一个项目服务端接口有性能问题,需要进行优化.在接口多次修改中,实体添加了很多字段用于中间计算或者存储,然后最终用Newtonsoft.Json进行序列化返回数 ...

随机推荐

  1. grep检索文本

    grep [OPTIONS] PATTERN [FILE...] grep zifuchuan  * 不行的话来一个: grep zifuchuan  */* 不行的话再来一个: grep zifuc ...

  2. PHP urlencode

    url get传参时,对参数值需要用urlencode()处理,防止参数中含有特殊字符&等 例如: 一产品名称为A&T Plastic,在产品列表中就产生了这样的一个联接<a h ...

  3. Oracle起步---创建临时表空间/表空间/创建用户/授权

    1. 安装: 百度一下你就知道 2. sqlplus登录/sqlplus命令登录 在安装Oracle时,你需要记住设置的“全局数据库名”(默认为orcl) 和 口令,在以两种方式登录时: 用户名: s ...

  4. Spring Mvc 上传文件Demo 实例

    返得利购物. 淘宝.京东500家商城合作,包括全面的商城返利网.注冊就送5元,购物就有返利.随时提现. 同学们,新一轮的返利大潮正在慢慢靠近,让购物都认为自己在赚钱.购物,机票.游戏.酒店旅游,地方特 ...

  5. sqlmap注入教程

    1.SQLMAP用于Access数据库注入 (1)猜解是否能注入win: python sqlmap.py -u "http://www.stronkin.com/en/CompHonorB ...

  6. 深入理解--SSM框架中Dao层,Mapper层,controller层,service层,model层,entity层都有什么作用

    SSM是sping+springMVC+mybatis集成的框架. MVC即model view controller. model层=entity层.存放我们的实体类,与数据库中的属性值基本保持一致 ...

  7. 【BZOJ4152】[AMPPZ2014]The Captain 最短路

    [BZOJ4152][AMPPZ2014]The Captain Description 给定平面上的n个点,定义(x1,y1)到(x2,y2)的费用为min(|x1-x2|,|y1-y2|),求从1 ...

  8. APP上传应用商店加固后打包

    在cmd进入jdk的bin目录,把keystore文件和apk安装包放到bin目录下,然后执行以下命令,需要管理员权限: jarsgner -verbose -sigalg SHA1withRSA - ...

  9. 品友推广的投放原理 RTB:Real Time Bidding(实时竞价) DSP:Demand-Side Platform(需求方平台) 广告交易平台:AD Exchange

    总结: 1.实时竞价 0.1秒出价各个广告主出价,投放价高者: RTB(Real Time Bidding)实时竞价,是一种利用第三方技术在数以百万计的网站或移动端针对每一个用户展示行为进行评估以及出 ...

  10. SOE不能进入断点调试

    一.前言 任何程序开发,如果不能进入断点调试,是非常的痛苦的. 如果有过SOE开发经验的人都知道,SOE开发过程中调试是非常麻烦的.任何在SOE开发模板中的修改都需要重新编译工程,重新生成.soe 文 ...