Mac OS x 搭建svn服务器

1.Mac系统自带svn,打开终端,确定系统已经安装了svnserve

1
2
3
4
5
6
7
8
9
10
11
12
bogon:~ Austin$ svnserve --version
svnserve, version 1.7.17 (r1591372)
compiled Aug 7 2014, 17:03:25
Copyright (C) 2014 The Apache Software Foundation.
This software consists of contributions made by many people; see the NOTICE
file for more information.
Subversion is open source software, see http://subversion.apache.org/
The following repository back-end (FS) modules are available:
* fs_fs : Module for working with a plain file (FSFS) repository.

2.创建仓库

1
2
3
4
5
6
7
bogon:~ Austin$ sudo mkdir -p /Users/Austin/Desktop/svn
bogon:~ Austin$ sudo svnadmin create /Users/Austin/Desktop/svn
//创建完成
bogon:svn Austin$ cd /Users/Austin/Desktop/svn
bogon:svn Austin$ ls
README.txt db hooks
conf format locks

3.修改配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//修改conf文件夹下的passwd文件
//添加了两个用户,并分别设置了密码
user1 = user1
user2 = user2
//修改conf下的authz文件,设置权限
[groups]
user1 = user1
user2 = user2
[/]
@user1 = rw
@user2 = r
[local:/]
@user1 = rw
@user2 = r

4.启动SVN

1
sudo svnserve -d -r /Users/Austin/Desktop/svn

5.解决提交.a 文件不到svn的问题
前往文件夹中输入~/.subverison 打开config,找到# global-ignores = .o .lo .la .al .libs .so .so.[0-9] .a .pyc .pyo
在下面添加一行,global-ignores = build ~.nib .so .pbxuser .mode .perspective,修改后结构如下

1
2
3
4
5
6
7
### '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'.
# global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo
# add begin ............
global-ignores = build *~.nib *.so *.pbxuser *.mode *.perspective*
# add end ............
# *.rej *~ #*# .#* .*.swp .DS_Store
### Set log-encoding to the default encoding for log messages