CentOS 6.5安裝SVN 客戶端TortoiseSVN

轉載地址:http://www.linuxidc.com/Linux/2015-01/111748.htm

TortoiseSVN簡介

TortoiseSVN 是 Subversion 版本控制系統的一個免費開源客戶端,可以超越時間的管理文件和目錄。文件保存在中央版本庫,除了能記住文件和目錄的每次修改以外,版本庫非常像普通的文件服務器。你可以將文件恢復到過去的版本,並且可以通過檢查歷史知道數據做了哪些修改,誰做的修改。這就是爲什麼許多人將 Subversion 和版本控制系統看作一種“時間機器”。

環境說明

系統版本:CentOS 6.5,內核(uname -r):2.6.32-431.el6.x86_64

安裝命令:

yum install -y subversion

SVN客戶端命令:

查看svn命令幫助:

svn help

查看子命令幫助:

svn checkout --help

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

svn list --help

list (ls): List directory entries in the repository.
usage: list [TARGET[@REV]...]

  List each TARGET file and the contents of each TARGET directory as
  they exist in the repository.  If TARGET is a working copy path, the
  corresponding repository URL will be used. If specified, REV determines
  in which revision the target is first looked up.

  The default TARGET is '.', meaning the repository URL of the current
  working directory.

  With --verbose, the following fields will be shown for each item:

    Revision number of the last commit
    Author of the last commit
    If locked, the letter 'O'.  (Use 'svn info URL' to see details)
    Size (in bytes)
    Date and time of the last commit

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
  -v [--verbose]          : print extra information
  -R [--recursive]        : descend recursively, same as --depth=infinity
  --depth ARG              : limit operation by depth ARG ('empty', 'files',
                            'immediates', or 'infinity')
  --incremental            : give output suitable for concatenation
  --xml                    : output in XML

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

svn list使用示例

svn list svn://192.168.231.1/SVNHome

遇到連接超時的錯誤:

CentOS 6.5安裝SVN 客戶端TortoiseSVN

查看連接的IP上是否已經啓動SVN服務,檢查防火牆端口開放狀態。

解決連通問題之後,會提示輸入“root”用戶的密碼,如下圖:

CentOS 6.5安裝SVN 客戶端TortoiseSVN

這裏使用其它用戶訪問,直接回車就可以了,然後提示輸入用戶名,輸入完成回車,

然後提示輸入密碼,輸入完成回車,如果輸入正確就可以看到類似的信息了。

svn checkout使用示例

先創建一個目錄,例如:mkdir test

檢出到test目錄下

svn checkout svn://192.168.231.1/SVNHome ./test

由於之前已經選擇保存密碼了,所以這裏不再需要驗證,輸出如下圖:

CentOS 6.5安裝SVN 客戶端TortoiseSVN

Checked out revision 10.檢出成功,去test目錄下看看吧。

更新版本庫

切換目錄到之前檢出的文件目錄,然後執行命令:svn update

如果之前沒有選擇保存密碼,則會提示輸入檢出時使用的用戶的密碼!

如果需要使用其它用戶,則直接按回車,這樣就會提示你輸入用戶名,輸入用戶名之後按回車,會提示輸入密碼,輸入正確並且用戶有權限的話,就會開始更新了。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章