linux下SVN客户端的安装与配置

作者:zccst


1,下载

http://subversion.apache.org/download/

共两个文件,分别是:subversion-1.6.21.tar.gzsubversion-deps-1.6.21.tar.gz

然后依次加压。


2,安装

# cd subversion-1.6.21
#./configure --prefix=/opt/svn
# make               #编译,如果提示错误, 则可能需要root权限 
# make install       #安装,此时可能需要root用户权限



3,配置

(1) 将svn命令链接到/usr/local/bin目录下(需要root权限):

ln –s /usr/local/subversion/bin/svn /usr/local/bin

测试是否已经可以在用户目录下使用svn:

svn help 如果出现命令列表,则表示已经链接成功。

(2) 使用chmod命令,使 list checkout commit这三个命令脚本有执行权限:

chmod 777 list checkout commit 
cp list checkout commit /usr/bin

svn客户端安装成功


4,出错及解决办法

测试一下:

svn checkout https://xxx.xxx.xxx/

结果报如下错误:svn: SSL is not supported

仔细一看,原因如下,svn --version显示,ra_neon 不支持https :

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
- handles 'http' scheme

从网上查了一下,说是在执行./configure 时要加上--with-ssl

ok,重新安装,如下:

wget http://www.openssl.org/source/openssl-1.0.0a.tar.gz

tar -zxvf openssl-1.0.0a.tar.gz

cd openssl-1.0.0a

./config
./config -t
make depend
make
make test
make install



重新安装一遍SVN
./configure --with-openssl=/usr/local/ssl --with-ssl
ok,这次执行成功,接着执行make,make install 即可。



现在再次执行svn --version,显示如下:

[wap@localhost boss]$ svn --version
svn, version 1.6.1 (r37116)
compiled Jun 17 2010, 14:59:48

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
- handles 'http' scheme
- handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
- handles 'http' scheme
- handles 'https' scheme



可以看到,现在https也支持了。



这次执行

svn checkout https://xxx.xxx.xxx/



成功。



5,co的提示

Error validating server certificate for 'https://svn.baidu.com:443':
 - The certificate is not issued by a trusted authority. Use the
   fingerprint to validate the certificate manually!
Certificate information:
 - Hostname: svn.baidu.com
 - Valid: from Tue, 16 Mar 2010 10:45:03 GMT until Fri, 13 Mar 2020 10:45:03 GMT
 - Issuer: baidu, baidu, BEIJING, BEIJING, CN
 - Fingerprint: ad:77:84:4d:5d:fb:7a:c8:f7:2e:fb:48:20:86:3a:0e:73:43:e7:62
(R)eject, accept (t)emporarily or accept (p)ermanently?

直接P


如果不行,参考如下解决办法

照理直接按p就可以让svn以后忽略这个问题了,但是很奇怪,即便选择了p,下次操作时还是会提示同样的经过高,如果我只用命令操作问题

也不是太大,但是如果要用xcode进行代码的控制的话,就非常蛋疼了,简直没法用。

但是这也不是什么大问题,只要在 ~/.subversion/servers 中添加几行配置就轻松搞定了 具体操作如下:

(1) 用命令打开servers配置文件:open  ~/.subversion/servers 

  (2)   在servers配置文件的末尾添加:

          ssl-ignore-host-mismatch = true
          ssl-ignore-unknown-ca = true
          ssl-ignore-invalid-date = true 

 (3) 我是这样搞定的,你试试吧

-----------------------------------------------------------------------
ATTENTION!  Your password for authentication realm:

   <https://svn.baidu.com:443>  Subversion

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'.
-----------------------------------------------------------------------


阅读更多
换一批

没有更多推荐了,返回首页