一、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. ubuntu1204-gedit中文乱码

    1 在界面上使用ALT-F2打开"执行应用程序"界面. 2 输入dconf-editor.然后点击"执行"打开"Configuration Edito ...

  2. Oracle 10gR2 RAC 启动与关闭

    一. 检查共享设备 一般情况下, 存放OCR 和 Voting Disk 的OCFS2 或者raw 都是自动启动的. 如果他们没有启动,RAC 肯定是启动不了的. 1.1 如果使用ocfs2的,检查o ...

  3. Linux动态库搜索路径的技巧

    众所周知,Linux动态库的默认搜索路径是/lib和/usr/lib.动态库被创建后,一般都复制到这两个目录中.当程序执行时需要某动态库,并且该动态库还未加载到内存中,则系统会自动到这两个默认搜索路径 ...

  4. encodeURI() 的用法

    定义和用法 encodeURI() 函数可把字符串作为 URI 进行编码.[通用资源标识符(Uniform Resource Identifier, 简称"URI")] 语法 en ...

  5. JAVA环境变量配置备忘

    jdk1.6以上就不需要配置classpath了:系统会自动帮你配置好 选择“高级”选项卡,点击“环境变量”:在“系统变量”中,设置3项属性,JAVA_HOME,PATH,CLASSPATH(大小写无 ...

  6. 3969 [Mz]平方和【斐波那契平方和】

    3969 [Mz]平方和  时间限制: 1 s  空间限制: 64000 KB  题目等级 : 大师 Master 题解  查看运行结果     题目描述 Description 斐波那契数列:f[0 ...

  7. fis3 部署手册

    为什么使用FIS3 项目上线一段时间后如果更新JS或CSS文件,而客户端已经对该文件缓存过了,那就有可能会无法及时更新而继续采用旧的JS或CSS文件,无法达到想要的效果. 处理类似情况最有效的解决方案 ...

  8. 记一次Project插件开发

    一.开发背景 最近在使用微软的Office Project 2010 进行项目管理,看到排的满满的计划任务,一个个地被执行完毕,还是很有成就感的.其实,不光是在工作中可以使用Project进行项目进度 ...

  9. javajava持有对象(容器类)

    数组是固定的长度去保存对象,还有一些集合类如基本的List.Set.Quene.Map可以存储不固定长度的对象.

  10. 170223、Tomcat部署时war和war exploded区别以及平时踩得坑

    war和war exploded的区别 在使用IDEA开发项目的时候,部署Tomcat的时候通常会出现下边的情况: 是选择war还是war exploded 这里首先看一下他们两个的区别: war模式 ...