1、创建svn目录
sudo apt-get install subversion subversion-tools
mkdir /opt/svn/repo
svnadmin create /opt/svn/repo
2、修改配置文件
项目配置文件都在创建目录的conf子目录下:
cd /opt/svn/repo/conf
ls
- 打开passwd文件,配置用户信息
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.
[users]
lilei = C4I0M
hanmeimei = UJVkP
- 打开auth文件,配置用户对项目的访问权限:
### 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,
### - all authenticated users, using the '$authenticated' token,
### - only anonymous users, using the '$anonymous' token,
### - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').
[groups]
company_dev = lilei,hanmeimei
[/]
@company_dev = rw
- 修改svnserver.conf文件(供参考)
...
anon-access = none
auth-access = write
...
password-db = passwd
authz-db = authz
...
3、最后启动svn服务
svnserve -d --listen-port=8001 -r /opt/svn/repo
4、初始化导入代码(可选)
//将初始化代码上传到/root/repo, 然后执行:
svn import /root/repo /opt/svn/repo -m "Initial project"
5、本地检出
svn co svn://111.11.11.111:8001/repo