安装

sudo apt-get install subversion

常用指令(命令中解释了常用的option的用法,忽略了生僻的option)

1. 将文件(项目)checkout到本地目录

svn checkout srcURL --username ARG  --password ARG

例如:svn checkout http://www.mycodesvn.com/main --username Fowler --password 123456

简写 svn co

注:ARG 为 argument(参数)简写

2. 将文件添加到版本库中

svn add ARG

例如:svn add myFile.java

svn add *.java 将当前目录中所有.java文件添加到版本库中

注:这里的添加到版本库,与commit要区分开,add并只是将文件添加到版本库中,还没有提交到服务器,当下一次commit的时候,才会提交到svn服务器。参见英文对svn add的注解:

Put files and directories under version control, scheduling them for addition to repository.  They will be added in next commit.

3. 将改动的文件提交到版本库

svn commit -m ARG1 ARG2

ARG1:注释,必填的,但是可以是空串

ARG2:文件目录

例如:svn commit -m "this is my first commit" MyTest.java

英文注解:commit (ci): Send changes from your working copy to the repository.

A log message must be provided, but it can be empty.  If it is not  given by a --message or --file option, an editor will be started.
If any targets are (or contain) locked items, those will be  unlocked after a successful commit.
    4.加锁/解锁

svn lock -m ARG1 [--force] ARG2

ARG1:注释

ARG2:文件目录

--force:使用此选现可以从其他的user或者working copy强制获得lock

英文注解:lock: Lock working copy paths or URLs in the repository, so that no other user can commit changes to them.

相应的解锁:svn unlock

5. 更新到某个版本

svn update -r ARG1 ARG2

ARG1: 版本号

ARG2: 文件目录

英文注解:update (up): Bring changes from the repository into the working copy.

If no revision is given, bring working copy up-to-date with HEAD rev.  Else synchronize working copy to revision given by -r.
For each updated item a line will start with a character reporting the  action taken.  These characters have the following meaning:
    A  Added
    D  Deleted
    U  Updated
    C  Conflict
    G  Merged
    E  Existed

6. 查看文件或者目录状态

svn status path (显示目录下的文件和子目录的状态,正常状态不显示)

【?:不在svn的控制中;M:内容被修改;C:发生冲突;A:预定加入到版本库;K:被锁定】

svn status -v path

第一列保持相同,第二列显示工作版本号,第三和第四列显示最后一次修改的版本号和修改人。

英文注解:status (stat, st): Print the status of working copy files and directories.
With no args, print only locally modified items (no network access).
With -q, print only summary information about locally modified items.
With -u, add working revision and server out-of-date information.
With -v, print full revision information on every item.

7. 删除文件

svn delete ARG1 -m ARG2

ARG1:文件目录(路径)

ARG2:注释信息

英文注解:delete (del, remove, rm): Remove files and directories from version control.

1. Each item specified by a PATH is scheduled for deletion upon the next commit.  Files, and directories that have not been committed, are immediately removed from the working copy    unless the --keep-local option is given.
    PATHs that are, or contain, unversioned or modified items will not be removed unless the --force option is given.

2. Each item specified by a URL is deleted from the repository via an immediate commit.

8. 查看日志

svn log ARG

ARG:文件或者文件夹路径

英文注解:log: Show the log messages for a set of revision(s) and/or file(s).

Print the log messages for a local PATH (default: '.'). The default revision range is BASE:1.
    9. 查看文件详细信息

svn info path

英文注解:info: Display information about a local or remote item.
Print information about each TARGET (default: '.').
TARGET may be either a working-copy path or URL.  If specified, REV determines in which revision the target is first looked up.

10. 比较差异

svn diff path(将修改的文件与基础版本比较)
svn diff -r m:n path(对版本m和版本n比较差异)

11. 将两个版本之间的差异合并到当前文件

svn merge -r m:n path(将版本m与n之间的差异合并到当前文件,但是一般都会产生冲突,需要处理一下)

12. 解决冲突

svn resolved: 移除工作副本的目录或文件的“冲突”状态。

Ubuntu中SVN的安装和使用相关推荐

  1. 【转】Ubuntu中SVN客户端安装+使用

    转自:Ubuntu中SVN客户端安装+使用_三少GG-CSDN博客 1. 安装 svn客户端: apt-get install subversion,然后根据提示一步一步,就完成了 svn的安装.当然 ...

  2. VM之Linux:Linux的Ubuntu中,解决安装后屏幕太小的问题

    VM之Linux:Linux的Ubuntu中,解决安装后屏幕太小的问题 导读 最讨厌网上回答的啰嗦和不清晰!本人最讨厌啰嗦,直接上来,图文表达,简单明了,快速解决问题!最讨厌网上答案一大片的废话和没有 ...

  3. lede更改软件源_Linux的上传和下载——Ubuntu中软件的安装和ftp服务器的搭建

    [Linux操作系统]Linux的上传和下载--Ubuntu中软件的安装和ftp服务器的搭建 学习完Linux终端命令以后,我们现在要考虑的是怎么实现Linux中文件的上传和下载,这就是我们本篇博客要 ...

  4. Ubuntu中anaconda的安装及使用

    Ubuntu中anaconda的安装及使用 (1) 在anaconda官方网站中下载相应的包. 网址>>https://www.anaconda.com/download/#linux ( ...

  5. ssh重装ubuntu_ubuntu光盘安装ssh Ubuntu中ssh的安装与用法 - Linux - 服务器之家

    ubuntu光盘安装ssh Ubuntu中ssh的安装与用法 发布时间:2017-04-05 来源:服务器之家 SSH分客户端openssh-client和openssh-server 如果你只是想登 ...

  6. Linux kodi添加中文,如何在Ubuntu中通过PPA安装Kodi 18.2并设置中文界面

    如何在Ubuntu中通过PPA安装Kodi 18.2并设置中文界面 Kodi "Leia" 18.2已经发布,其中包含许多错误修复和性能改进. 以下是如何在Ubuntu 16.04 ...

  7. Ubuntu中下载和安装Eclipse

    [背景] 需要在Ubuntu下弄一个Eclipse项目的编译. 其是C语言的,嵌入式项目. 所以,先要在Ubuntu中,下载和安装Eclipse. [折腾过程] 1.Ubuntu下,用Firefox打 ...

  8. ubuntu chrome java插件_在Ubuntu中为Chrome安装Java插件

    问题描述 我有JDK,在Ubuntu中一切正常,我是说IDE,一些应用程序,我能够开发和运行项目,但是我在Chrome中收到一条消息:Java(TM) is required to display t ...

  9. Ubuntu 中sendmail 的安装、配置与发送邮件的具体实现

    一.安装 ubuntu中sendmail函数可以很方便的发送邮件,ubuntu sendmail先要安装两个包. 必需安装的两个包: 代码  sudo apt-get install sendmail ...

最新文章

  1. 各类数据类型的用法java_Java各种数据类型详细介绍及其区别
  2. 程序员找不到对象是因为还没遇到一个有远见的丈母娘
  3. 论文浅尝 | AAAI2020 - 基于生成对抗的知识图谱零样本关系学习
  4. 你需要的阿里开源内核诊断工具:diagnose-tools
  5. 我的世界java放大化是什么_我的世界:你玩过神奇的放大化种子吗?官方:这些东西非常吃资源...
  6. 一文看懂神经网络工作原理
  7. 【无线网络技术】WLAN技术学习笔记
  8. 生成化学表达式下标、上标数字
  9. 数据库作业:SQL练习4 - SELECT(连接查询、嵌套查询)
  10. java时间戳是什么类型_java 获取时间戳的三种方式
  11. linux中pid,tid, 以及 真实pid的关系
  12. 数据结构-矩阵-三角矩阵(Java语言)
  13. 直播风口之下,视频社交会成为下一个流量平台吗?
  14. 事件驱动框架(二)——状态机
  15. Python math.cosh() 方法
  16. h5新增标签和表单属性
  17. yiii2生成验证码以及刷新验证码
  18. ISO13485认证流程
  19. 离职后,想去原来的公司上班怎么办?
  20. linux 仿QQ 2.0版本

热门文章

  1. 第六课-Android四大组件之Activity
  2. WP7基础学习---第一讲
  3. 防止电脑辐射必看 保护好你的肌肤 - 生活至上,美容至尚!
  4. https://github.com/nostra13/Android-Universal-Image-Loader
  5. mysql装载本地文件及模式匹配
  6. 好程序员web分享图片标签、绝对路径和相对路径
  7. 关于日志打印的几点建议以及非最佳实践
  8. Redis开发运维实践上线部署规划之持久化设置
  9. Android四大组件之——Activity(一)定义、状态和后退栈(图文详解)
  10. 虚拟系统管理VSM提高服务器整合率