1.安装Subversion-1.6.4.msi
2.安装Apache httpd-2.2.15-win32-x86-no_ssl.msi
3.建立SVN仓库
svnadmin create E:/SVNRepository/project
4.安装Subversion后台服务
svnservice -install -d -r E:/SVNRepository
5.打开Apache下的httpd.conf文件
将下面两段的注释取消
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
添加
LoadModule dav_svn_module modules/mod_dav_svn.so # 从Subversion安装目录下的bin目录下Copy到Apache的modules目录下
LoadModule authz_svn_module modules/mod_authz_svn.so # 同上
<Location /svn>
DAV svn
SVNParentPath E:/SVNRepository # SVN库的根目录
SVNAutoversioning on
AuthType Basic # 验证模式
AuthName "Subversion repository" # 验证提示名称
AuthUserFile E:/SVNRepository/projects/conf/passwd # SVN库下面对应项目的密码文件
AuthzSVNAccessFile E:/SVNRepository/projects/conf/authz # 设置SVN的权限控制
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user #Only valid users are allowed to access the URL
</LimitExcept>
</Location>
6.添加访问账号
# htpasswd 在Apache 的bin目录下
htpasswd E:/SVNRepository/projects/conf/passwd jacky
编辑E:/SVNRepository/projects/conf/auth文件
[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
admin = jacky
[/]
@admin = rw
# &joe = r
# * =
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
7.编辑E:/SVNRepository/projects/conf/svnserve.conf文件
[general]
anon-access = read
auth-access = write
password-db = passwd
realm = projects #项目名称 这里是projects
8.导入文件
svn import e:/tt svn://127.0.0.1/projects -m "initial import" --username jacky --password 123456
# SVN 命令:
http://www.open.collab.net/scdocs/ddUsingSVN_command-line.html.zh-cn
9.检出文件
svn checkout svn://127.0.0.1/projects e:/projects
10.添加文件
进入checkout的目录下
svn add svn.log
11.commit文件
svn commit -m "initial commit" # 提交当前目录下的全部文件
svn commit svn.log -m "initial commit" # 提交当前目录下的指定文件
12.delete文件
svn delete svn.log
svn commit -m "initial delete" # 在本地副本中删除文件后,只有commit后才会在服务器端删除