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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1. 安装svn客户端Linux系统中,可以通过命令行安装svn客户端。具体命令如下: ``` sudo apt-get update sudo apt-get install subversion ``` 2. 创建svn仓库 在Linux系统中,可以通过命令行创建svn仓库。具体命令如下: ``` sudo svnadmin create /svn/repos ``` 其中,`/svn/repos`为svn仓库的路径,可以根据实际情况进行修改。 3. 配置svn仓库 在Linux系统中,可以通过编辑svn仓库的配置文件来配置svn仓库。具体操作如下: 进入svn仓库的conf目录: ``` cd /svn/repos/conf ``` 编辑svnserve.conf文件: ``` sudo vi svnserve.conf ``` 将以下行取消注释并保存: ``` anon-access = read auth-access = write password-db = passwd ``` 编辑passwd文件: ``` sudo vi passwd ``` 添加用户名和密码: ``` [users] username = password ``` 4. 启动svn服务 在Linux系统中,可以通过命令行启动svn服务。具体命令如下: ``` sudo svnserve -d -r /svn/repos ``` 其中,`/svn/repos`为svn仓库的路径,可以根据实际情况进行修改。 5. 使用svn客户端Linux系统中,可以通过命令行使用svn客户端。具体命令如下: ``` svn co svn://localhost/repos/ projectname ``` 其中,`svn://localhost/repos/`为svn仓库的地址,`projectname`为要检出的项目的名称。检出后,可以通过命令行进行svn操作。例如,提交修改: ``` svn commit -m "commit message" ``` 完整的svn命令行操作请参考svn官方文档。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值