SVN搭建整理笔记

来源:互联网 发布:2016年度十大网络用语 编辑:程序博客网 时间:2024/05/20 10:12

可以先装好httpd

需要先下载neon-0.25.5.tar.gz  解压后改名为neon放在svn代码顶层,然后configure;make ;make install

 

vim /etc/httpd/conf.d/subversion.conf

<Location /repos>
DAV svn
SVNPath /var/www/svn/repos    (此处改为工程所在地址)
AuthType Basic
AuthName "Subversion repos"
AuthUserFile /etc/svn-auth-conf
Require valid-user
</Location>

 

指定账户和密码

htpasswd -cm /etc/svn-auth-conf yourusername
htpasswd -m /etc/svn-auth-conf anotherusername

 

创建软件仓库

cd /$project_path

svnadmin create repos

chown -R apache.apache repos
service httpd restart

 

导入已有工程:

svn import /tmp/mytestproj/ file:///var/www/svn/repos/mytestproj -m "Initial repository layout for mytestproj"
从仓库下载

svn co http://yoursvnserver/repos/mytestproj
提交到仓库

svn commit -m "Added a line to testconf1.cfg."

-m后的信息相当于修改日志。

 

添加或删除子项目

svn add configurations/CentOS-Base.repo
svn commit -m "Added the CentOS Yum repo file."

日志

svn log http://yoursvnserver/repos -- For the entire repository
svn log http://yoursvnserver/repos/mytestproj -- For the specific project
svn co -r 1 http://yoursvnserver/repos/mytestproj