Linux下搭建svn代码库

发表于:2015-6-08 10:00

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:郝峰波    来源:51Testing软件测试网采编

  1、安装svn客户端
  1.1、使用命令安装
  1)CentOS
  $ yum install subversion
  2)ubuntu
  sudo apt-get install subversion
  1.2、源码安装
  http://www.cnblogs.com/fengbohello/p/4142810.html
  2、开启svn服务进程
  2.1、我的习惯是把代码仓库放在/opt/svn目录下,所以先创建目录/opt/svn
  $ mkdir /opt/svn -p
  2.2、开启svn服务进程
  svnserve -d -r /opt/svn/
  这个命令的作用是开启svn服务进程,并且把/opt/svn/目录作为我们的svn服务的根目录。以后,当我们要在客户端checkout代码的时候,svn服务进程就会从这里开始进行查询,类似于apache的/var/www/目录的作用。
  运行如下命令检查svn服务是否开启了。
  # ps -ef | grep svn
  root      2572     1  0 09:22 ?        00:00:00 svnserve -d -r /opt/svn/
  如果,出现以上结果,这说明svn服务正常开启了。
  2.3、创建我们的第一个代码仓库:firsttest
  # cd /opt/svn/
  # svnadmin create firsttest
  这就创建了我们的第一个代码仓库,这个代码仓库的名字就叫做“firsttest”,可以看到其中的文件
  # ls firsttest/
  README.txt  conf  db  format  hooks  locks
  2.4、下面对我们的代码仓库进行权限设置
  1)进入conf目录
  # cd firsttest/conf/
  2)编辑svnserve.conf。这个文件是要告诉svn服务进程,我们的firsttest项目的认证权限和认证需要的密码文件以及认证文件的存放位置。
  在第8行左右找到“[general]”,对其下面的内容进行编辑
  # vim svnserve.conf
  ### Visit http://subversion.tigris.org/ for more information.
  [general]
  ### These options control access to the repository for unauthenticated
  ### and authenticated users.  Valid values are "write", "read",
  其中需要编辑的地方分别是
  2.1)
  ### and "none".  The sample settings below are the defaults.
  # anon-access = read
  # auth-access = write
  ### The password-db option controls the location of the password
  修改为
  ### and "none".  The sample settings below are the defaults.
  anon-access = none
  auth-access = write
  ### The password-db option controls the location of the password
  注意,红色的两行前面不能有空格,否个svn会读取失败,下面的修改也要注意这些。
21/212>
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号