学习啦>学习电脑>操作系统>Linux教程>

linux的svn之checkout命令

时间: 佳洲1085 分享

  linux的checkout命令是linux的svn的常用命令之一。下面由学习啦小编为大家搜集整理了linux的svn之checkout命令的相关知识,希望对大家有帮助!

  linux的svn之checkout命令

  常用检出命令:

学习啦在线学习网   svn co http://路径(目录或文件的全路径) [本地目录全路径] --username 用户名 --password 密码

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

学习啦在线学习网   svn checkout http://路径(目录或文件的全路径) [本地目录全路径] --username 用户名

学习啦在线学习网   svn checkout svn://路径(目录或文件的全路径) [本地目录全路径] --username 用户名

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

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

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

  svn的checkout命令实例

  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

  知识扩展: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

3632373