SVN常用命令之checkout

SVN常用命令之checkout

官方解释,请参考:http://www.subversion.org.cn/svnbook/nightly/svn.ref.svn.c.checkout.html

常用检出命令:

svn co http://路径(目录或文件的全路径) [本地目录全路径]  –username 用户名 –password 密码

svn co svn://路径(目录或文件的全路径) [本地目录全路径]  –username 用户名 –password 密码

svn checkout http://路径(目录或文件的全路径) [本地目录全路径] –username 用户名

svn checkout svn://路径(目录或文件的全路径) [本地目录全路径]  –username 用户名

 

注:如果不带–password 参数传输密码的话,会提示输入密码,建议不要用明文的–password 选项。

  其中 username 与 password前是两个短线,不是一个。

  不指定本地目录全路径,则检出到当前目录下。

例子:

svn co svn://192.168.0.3/测试工具 /home/testtools –username luke

svn co http://192.168.0.3/test/testapp –username luke

svn checkout svn://192.168.0.3/测试工具 /home/testtools –username luke

svn checkout http://192.168.0.3/test/testapp –username luke

 

标注自己实验过的代码:

svn checkout http://XXXX/cxb/weijifen/code/trunk/web/XXX /home/cxb/src/XXX

svn checkout http://XXXXX/cxb/weijifen/code/trunk/web/trunk . /home/cxb/src/XXX

 

检出指定具体版本:

svn co http://路径(目录或文件的全路径) [本地目录全路径] [–revision] –username 用户名 –password 密码

 

svn checkout svn://路径(目录或文件的全路径) [本地目录全路径] [–revision] –username 用户名

svn co [–revision] http://路径(目录或文件的全路径) [本地目录全路径] –username 用户名 –password 密码

svn checkout [–revision] svn://路径(目录或文件的全路径) [本地目录全路径] –username 用户名

svn checkout http://siphon.googlecode.com/svn/trunk/ siphon -r r791
svn checkout -r r791 http://siphon.googlecode.com/svn/trunk/ siphon 


检出不包括源文件夹根目录:

比如我要checkout   trunk/ 下面的所有文件,但是不包括trunk 文件夹

我们可以在svn文件夹后面打个空格,在加个“.”就行了

svn co http://192.168.1.10/svn/project/trunk/ /home/DSP-OPEN

改为:
svn co http://192.168.1.10/svn/project/trunk/ . /home/DSP-OPEN

查看更多关于checkout参数使用的命令:svn help checkout
[root@ltegr ~]# svn help checkout
checkout (co): Check out a working copy from a repository.
usage: checkout URL[@REV]… [PATH]

  If specified, REV determines in which revision the URL is first
  looked up.

  If PATH is omitted, the basename of the URL will be used as
  the destination. If multiple URLs are given each will be checked
  out into a sub-directory of PATH, with the name of the sub-directory
  being the basename of the URL.

  If –force is used, unversioned obstructing paths in the working
  copy destination do not automatically cause the check out to fail.
  If the obstructing path is the same type (file or directory) as the
  corresponding path in the repository it becomes versioned but its
  contents are left ‘as-is’ in the working copy.  This means that an
  obstructing directory’s unversioned children may also obstruct and
  become versioned.  For files, any content differences between the
  obstruction and the repository are treated like a local modification
  to the working copy.  All properties from the repository are applied
  to the obstructing path.

  See also ‘svn help update’ for a list of possible characters
  reporting the action taken.

Valid options:
  -r [–revision] ARG      : ARG (some commands also take ARG1:ARG2 range)
                             A revision argument can be one of:
                                NUMBER       revision number
                                ‘{‘ DATE ‘}’ revision at start of the date
                                ‘HEAD’       latest in repository
                                ‘BASE’       base rev of item’s working copy
                                ‘COMMITTED’  last commit at or before BASE
                                ‘PREV’       revision just before COMMITTED
  -q [–quiet]             : print nothing, or only summary information
  -N [–non-recursive]     : obsolete; try –depth=files or –depth=immediates
  –depth ARG              : limit operation by depth ARG (’empty’, ‘files’,
                            ‘immediates’, or ‘infinity’)
  –force                  : force operation to run
  –ignore-externals       : ignore externals definitions

Global options:
  –username ARG           : specify a username ARG
  –password ARG           : specify a password ARG
  –no-auth-cache          : do not cache authentication tokens
  –non-interactive        : do no interactive prompting
  –trust-server-cert      : accept unknown SSL server certificates without
                             prompting (but only with ‘–non-interactive’)
  –config-dir ARG         : read user configuration files from directory ARG
  –config-option ARG      : set user configuration option in the format:
                                 FILE:SECTION:OPTION=[VALUE]
                             For example:

                                 servers:global:http-library=serf

 


知识扩展:
1、check out跟check in对应,export跟import对应。
check out导出获得文件后,导出的文件仍处于SVN版本控制中,与版本库保持关联,比如你可以进行Svn Update或者Svn Commit操作。
同时导出文件夹下有一个.svn的隐藏文件夹,存储着一些版本的元数据信息。export 简单导出一个版本的数据,导出的文件脱离SVN版本控制,修改后无进行Update和Commit操作。导出文件夹下没有.svn目录。

注:如果不带–password 参数传输密码的话,会提示输入密码,建议不要用明文的–password 选项。

  其中 username 与 password前是两个短线,不是一个。

  不指定本地目录全路径,则检出到当前目录下。

例子:

svn co svn://192.168.0.3/测试工具 /home/testtools –username luke

svn co http://192.168.0.3/test/testapp –username luke

svn checkout svn://192.168.0.3/测试工具 /home/testtools –username luke

svn checkout http://192.168.0.3/test/testapp –username luke

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/113249.html原文链接:https://javaforall.net

(0)
上一篇 2021年10月21日 下午8:00
下一篇 2021年10月21日 下午9:00


相关推荐

  • 批处理删除指定文件或文件夹

    批处理删除指定文件或文件夹批处理删除指定文件或文件夹 1 DEL1 1DEL 的命令参数 1 2 用 DEL 命令删除文件 1 3 在 cmd 中查看 DEL 的帮助 2 RD2 1RD 的命令参数 2 2 用 RD 删除文件夹 2 3 在 cmd 中查看 RD 的帮助 1 DEL1 1DEL 的命令参数使用 del 命令能指定文件 Del erase Drive Path FileName 指删除指定文件 指定要删除的文件或文件集的位置和名称 语法格式如下 del Drive Path FileName

    2026年3月18日
    2
  • 用bat批量重命名图片_快速批量修改图片名称

    用bat批量重命名图片_快速批量修改图片名称问题描述:业务中遇到需要批量修改大量图片的名字。如下图,需要修改为图片名字“u=”之后和“,”之前的那一串解决思路1:bat批处理,网上查找相关代码如下:1@echooff2SetL

    2022年8月5日
    12
  • 与,或,非,与非,或非,异或,同或,与或非概念_与或非异或的符号

    与,或,非,与非,或非,异或,同或,与或非概念_与或非异或的符号首先把中文意思和英文简写一一作出对应:与:and或:or…

    2022年10月12日
    3
  • python wxpython菜鸟教程_wxpython新手向教程

    python wxpython菜鸟教程_wxpython新手向教程wxpython教程手写wxpython会有各种问题,可以去下载wxformbuilder布局管理器然后去百度一下这个布局管理器的教程,这里太多了不多赘述。两种创建窗口方式:classMyFrame(wx.Frame)和classMyPanel(wx.Panel)来继承wx.Frame和wx.Panel,但是用wxformbuilder来创建布局和窗口会自动帮忙写好。继承wx.Frame的结尾…

    2022年5月22日
    28
  • 二叉树经典问题——已知中序和前序重建二叉树

    二叉树经典问题——已知中序和前序重建二叉树运用前序和中序序列重建二叉树及其相关应用重建过程1,在二叉树的学习中经常会遇到一类问题,就是给出一棵二叉树的前序和中序序列(后序和中序类似)然后求树的深度、树的后序序列、树的各种遍历等等问题,这个时候如果能根据相关的序列把其代表的二叉树重建出来,那么所有的问题便会迎刃而解。博文的第一部分就给出相关的重建步骤。2,重建中最关键的一点是从前序中找根然后在后序中用相应的根把树‘分解’。举个例子:

    2022年6月11日
    32
  • 用Visio画软件(模块)功能图

    用Visio画软件(模块)功能图最开始自己也不会画 画了好久也没画出自己心中所想的 比如下图这样的 在形状框中搜索 方块 其中的图形有 框 和 多树枝直角 这两个组件从左边的 框 拖动到右边的幕布上 自己调整大小 双击编辑文字 选中可以在上方功能栏选择 设计 改变框的颜色和样式下滑 方块 栏 找到 多树枝直角 并拖动到右侧白色的圈圈可以调整它的位置方向和高度 调整后如下 黄色的圈圈可以链接子功能框 两个就代表可以链接两个子功能框 若两个不够 可以从中间的黄色圈圈再拖出来一个 拖动黄色圈圈也可以

    2026年3月19日
    1

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号