Mac自带svnserver, 输入svnserve —version localhost:~ nancr$ svn --version svn, version 1.6.5 (r38866) compiled Oct 7 2009, 13:00:41 1 创建svn仓库 mkdir svn > 创建仓库 svnadmin create /Users/nancr/svn/repository 查看仓库目录下的内容 localhost:repository nancr$ ll /Users/nancr/svn/repository/ total 16 drwxr-xr-x 8 nancr staff 272 5 31 00:19 . drwxr-xr-x 3 nancr staff 102 5 30 20:03 .. -rw-r--r-- 1 nancr staff 229 5 30 20:03 README.txt drwxr-xr-x 5 nancr staff 170 5 31 02:10 conf drwxr-sr-x 16 nancr staff 544 5 31 02:05 db -r--r--r-- 1 nancr staff 2 5 30 20:03 format drwxr-xr-x 11 nancr staff 374 5 30 20:03 hooks drwxr-xr-x 4 nancr staff 136 5 30 20:03 locks 注:所有文件都在db中存储,根目录为svn自定义目录 2 配置 cd /Users/nancr/svn/repository/conf/ > 编辑svnserve.conf文件(用来指定passwd和authz配置文件,具体配置在passwd和authz配置文件中),将下面几项的注视去掉,并且前面一定不要有空格 anon-access = none auth-access = write password-db = passwd authz-db = authz > 编辑passwd文件(添加所有的用户名以及对应密码) [users] # harry = harryssecret # sally = sallyssecret zhangsan = zhangsan lisi = lisi maziwu = maziwu gedaliu = gedaliu longdidi = longdidi > 编辑authz文件, 为用户分组, 并对组(或者某个用户)添加相应的权限 [groups] nancr_and_zhangsan = nancr,zhangsan lisi_maziwu_and_gedaliu = lisi,maziwu,gedaliu [/] nancr = rw [/work] zhangsan = rw [/longdidi] @lisi_maziwu_and_gedaliu = rw longdidi = r zhangsan = 注: 3 启动 sudo svnserve -d -r /Users/nancr/svn/repository --log-file=/var/log/svn.log 4 验证 svn checkout svn://localhost/ --username nancr 结果: 补充: # 编辑sudo vim /etc/rc.local(Mac默认无此文件,需要手动创建), 添加 svnserve -d -r /Users/nancr/svn/repositories --log-file=/var/log/svn.log |