首先,感谢jsntghf和星辰的天空的好文分享,不是他们的文章,我估计须要花费更多的精力和时间。在这里我只是对他们文章的润色和本身测试遇到问题的标注。html
Mac自带了svn服务器和客户端,因此只须要简单配置一下就可使用apache
1. 建立svn repository服务器
Shell代码微信
svnadmin create /Users/mac22/svn/repository
svnadmin: E000002: Repository creation failed
svnadmin: E000002: Could not create top-level directory
svnadmin: E000002: Can't create directory '/Users/mac22/svn/repository': No such file or directory
注:mac22是当前登陆的用户名,你须要把它更换成你本身的用户名,在建立的时候确保已经svn/repository已经存在,上面的错误就是我没有建立svn/repository形成的网络
若是在终端输入svnadmin create /Users/mac22/svn/repository 代码,无提示说明建立成功,以下图所示:less
2. 配置svn用户权限/Users/mac22/svn/repository/conf/目录下存在3个文件: authz、passwd、snvserve.confide
你能够选择使用文本编辑打开,也可使用终端打开,我这里选择了后者svn
Shell 代码测试
martins-mac:conf mac22$ cd /Users/mac22/svn/repository/conf
martins-mac:conf mac22$ ls
authz passwd svnserve.conf
martins-mac:conf mac22$ vi authz
解释一下主要的几个命令:cd:进入某一个目录;ls:浏览当前目录的子目录 vi: 对文件进行编辑
authz 用户权限分配内容显示以下,而后按"i"键进行编辑:ui
### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to:
### - a single user,
### - a group of users defined in a special [groups] section,
### - an alias defined in a special [aliases] section,