搭建本机的SVN服务, svn: E200002: line 19: Option expected的解决方案

本机搭建SVN服务的好处是代码安全. 不会被黑, 专门有一类黑客黑源代码的

本机SVN搭建还有个好处: 客户端版本和服务器端版本一致 . SVN 低版本服务器端是不能链接SVN 高版本的客户端的.

Ubuntu 中安装svn服务器的具体步骤如下

转自http://blog.163.com/longsu2010@yeah/blog/static/173612348201202114212933/

Ubuntu 下大同小异, 只是把 yum install 命令换成了 apt install 而已

按链接中的教程, 创建完svn 仓库后, 不需要启动svn服务, 就可以本地用绝对路路径测试
sudo svn co file://[svn create命令的绝对路径]

取出版本 0.

本地第一次提交

我们有一套推荐的方式,创建一个trunk目录来保存开发的“主线”,一个branches目录存放分支拷贝,tags目录保存标签拷贝
home/用户名 目录下, 打开终端, 输入:
mkdir -p test_svn/{trunk,tags,branches}

第一次提交:
sudo svn import test_svn file:///home/用户名 -m "test_svn"

正在增加       test_svn/branches
正在增加       test_svn/tags
正在增加       test_svn/trunk
正在读取事务
提交后的版本为 1。

第一次取出:
svn co file://home/用户名/trunk 本地目录

取出版本 1。

但是, 远程链接怎么也不行
svn co svn://localhost:3690/trunk 本地目录

svn: E170013: Unable to connect to a repository at URL 'svn://localhost/trunk'
svn: E200002: line 19: Option expected

花了几分钟搜索, 原因终于找到了
转自http://bbs.csdn.net/topics/390675827

这个svn搞定了,是conf下面的配置文件前面取消注释的时候有空格,去掉空格就行了,这个svn服务搭建对配置空格要求特别严格,有些需要空格,有些必须每空格,不然总是出错。我的是windows 7
udo vim [你的svn create命令指定的目录]/conf/svnserve.conf
把19行以及以后的的空格删除

关闭之前的 svn 服务
ps -x
kill [svnserver任务的PID]

再次启动 svn 服务
svnserver -d -r [svn create命令的绝对目录]

认证领域:  /home/sxcai188/svn
“sxcai188”的密码: 

果然可以了

以后一定注意配置文件的空格!
以后一定注意配置文件的空格!!
以后一定注意配置文件的空格!!!

附录

附录A - svn 服务端的三种方式和他们的优缺点

以下内容转自官方文档: Chapater 6

The svnserve Server

svn:// or svn+ssh://
这类链接会使用 Server 方式链接到 svn 服务器

svnserve -d -r /var/svn
‘-r’ 参数后的路径是the root of the remote filesystem space. Clients 的 URLs不必再带绝对路径, 只要用相对于’-r’ 参数后的路径的相对路径就可以访问了. 假设服务器有这个目录 /var/svn/project1 , 那么以下命令就能下载 project1 项目到本地:

svn checkout svn://host.example.com/project1

Why you might want to use it:
好用不慢
Network protocol is stateful and noticeably faster than WebDAV.
No need to create system accounts on server.
Password is not passed over the network.
Why you might want to avoid it:
By default, only one authentication method is available, the network protocol is not encrypted, and the server stores clear text passwords. (All these things can be changed by configuring SASL, but it’s a bit more work to do.)
No advanced logging facilities.
No built-in web browsing. (You’d have to install a separate web server and repository browsing software to add this.)

svnserve over SSH

Why you might want to use it:
The network protocol is stateful and noticeably faster than WebDAV.

You can take advantage of existing SSH accounts and user infrastructure.

All network traffic is encrypted.

Why you might want to avoid it:
Only one choice of authentication method is available.

No advanced logging facilities.

It requires users to be in the same system group, or use a shared SSH key.

If used improperly, it can lead to file permission problems.

The Apache HTTP Server

Why you might want to use it:
It allows Subversion to use any of the numerous authentication systems already integrated with Apache.

There is no need to create system accounts on the server.

Full Apache logging is available.

Network traffic can be encrypted via SSL.

HTTP(S) can usually go through corporate firewalls.

Built-in repository browsing is available via web browser.

The repository can be mounted as a network drive for transparent version control (see the section called “Autoversioning”).

Why you might want to avoid it:
Noticeably slower than svnserve, because HTTP is a stateless protocol and requires more network turnarounds.

Initial setup can be complex.

你可能感兴趣的:(版本控制,项目管理)