1.创建一个文件夹 ex: 在 /users/(用户名)/ 下建一个 SVN (空文件夹)
2.打开终端 输入 svnadmin create /users/(用户名)/SVN/svnfile Enter
3.Enter 之后 svnfile 下会生成四个文件夹、两个文件; 其中,要修改conf中的三个文件来添加用户及密码。
在终端输入
(1) vi svnserve.conf 修改其中句话即 加粗字体的四行代码
把前面的# 及空格删掉就可以了
### users have read and write access to the repository.
anon-access = read
auth-access = write //这两者是控制访问
### The password-db option controls the location of the password
### database file. Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd //控制密码的位置
### The authz-db option controls the location of the authorization
### rules for path-based access control. Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file. If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz //控制授权的位置
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa. The default realm
### is repository's uuid.
(2) vi passwd
在[users]下方添加用户及密码
ex:
[users]
user = 123456
user 是用户名 123456 是密码
其中[users]下方可以添加多个用户
(3) vi authz
在[groups]下添加
topgroup = user,user1,user2
用户之间用逗号隔开
设置用户权限
[/]
@topgroup = rw //可读可写
4.退出authz 后要启动SVN
在终端输入
svnserve -d -r /users/(用户名)/SVN/svnfile
如果没有任何提示语....就是创建成功了
但是如果一直出现 svnserve: Can't bind server socket: Address already in use
那么 可以打开 活动监视器 在搜索框中搜索 SVN 然后把所有的进程都关掉
再次在终端中 输入 svnserve -d -r /users/(用户名)/SVN/svnfile
只要之前的代码没有错误,那么这一步之后就会成功了