一、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. 【转】Windows Dump文件获取

    dump文件是进程的内存镜像.可以把程序的执行状态,即当时程序内存空间数据通过调试器保存到dump文件中. 1.利用WinDbg里的adplus来获取dump文件 Adplus.vbs 是一个Visu ...

  2. java集合 stream 相关用法(1)

    java8新增一种流式数据,让操作集合数据更简单方便. 定义基本对象: public class Peo { private String name; private String id; publi ...

  3. 转载:定位ARM Hard Fault 的方法

    转载自:http://www.openedv.com/posts/list/25030.htm 1.用Keil的话,可以做如下操作: 先将fault中断函数的内容改为: HardFault_Handl ...

  4. Leetcode-Construct Binary Tree from inorder and postorder travesal

    Given inorder and postorder traversal of a tree, construct the binary tree. Solution: /** * Definiti ...

  5. 170117、spring解决乱码

    spring解决乱码这个问题网上有很多解决方法,也可以关注本博客的文章,在此不再赘述, 今天推荐大家另外两种解决方法! 问题现象: 1.后台代码 2.前端界面 解决方法: 方法1:是在后台请求方法上加 ...

  6. js function,prototype,sub.

    Ojbect 和Function 与普通函数和实例对象 1.实例对象的proto 指向构造函数的原型对象 2.实例对象的proto 指向Ojbect的原型 3.所有函数的proto 都指向Functi ...

  7. maven安装,maven命令行使用

    1 下载maven,解压(无需安装),配置环境变量,命令行mvn -v测试. 2 maven常用命令:https://www.cnblogs.com/wkrbky/p/6352188.html 3 注 ...

  8. onchange事件可以使用于: <input>, <select>, 和 <textarea>。

    onchange 事件会在域的内容改变时发生. onchange 事件也可用于单选框与复选框改变后触发的事件.

  9. 最全的Eclipse使用快捷键

    Eclipse 是一种基于 Java 的可扩展开源开发平台.尽管 Eclipse 是使用 Java 语言开发的,但它的用途并不限于 Java 语言,Eclipse 还包括插件开发环境等,下面将为大家介 ...

  10. python setup.py install 报错:error: [WinError 3] 系统找不到指定的路径。: 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\PlatformSDK\\lib

    Outline 在通过 setup.py 安装python模块时,遇到了以下报错: # 执行 python setup.py install # 报错: error: [WinError 3] 系统找 ...