1、安装svn客户端

2、创建svn代码库


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 : ? :: 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会读取失败,下面的修改也要注意这些。

  2.2)

### Uncomment the line below to use the default password file.
# password-db = passwd
### The authz-db option controls the location of the authorization

  改为

### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization

  2.3)

### Uncomment the line below to use the default authorization file.
# authz-db = authz
### This option specifies the authentication realm of the repository.

  修改为

### Uncomment the line below to use the default authorization file.
authz-db = authz
### This option specifies the authentication realm of the repository.

  对于一般的情况,修改到这里就可以了,下面的选项是加密选项等的加强版,这里就不说了。

  3)下面修改passwd文件。

# vim passwd

  3.1)找到“[users]”,在此选项下添加用户“woshihehe”,“woshihehe”用户对应的密码是“123456”

[users]
# harry = harryssecret
# sally = sallyssecret
woshihehe =

  4)修改authz文件

# vim authz

  在最后添加两行

# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
[/]
woshihehe=rw

  这两行的意思是,目录[/](代码根目录)下的所有文件,如果没有特殊约定的话,woshihehe用户将具有读(r)和写(w)的权限。

3、下载代码

  假如我的svn服务器的IP是192.168.1.105,在其它的机器上,执行如下代码

# svn co svn://192.168.1.105:/firsttest --username woshihehe
认证领域: <svn://192.168.1.105:3690> My First Repository
“woshihehe”的密码:

  那么接下来输入密码就可以了

-----------------------------------------------------------------------
注意! 你的密码,对于认证域: <svn://192.168.1.105:3690> My First Repository 只能明文保存在磁盘上! 如果可能的话,请考虑配置你的系统,让 Subversion
可以保存加密后的密码。请参阅文档以获得详细信息。 你可以通过在“/root/.subversion/servers”中设置选项“store-plaintext-passwords”为“yes”或“no”,
来避免再次出现此警告。
-----------------------------------------------------------------------
保存未加密的密码(yes/no)?yes
取出版本 。

  填写yes,这样我们就取出了我们的代码,版本是0。这时候就可以在里面添加目录和文件了。不过这个是如何使用svn了,这里就细说了。

linux下搭建svn代码库的更多相关文章

  1. linux下搭建svn本地服务器

    在linux下搭建svn本地服务器可以很好的管理自己的代码,具体过程如下: # mkdir svn_local # cd svn_local  # svnadmin create led_diplay ...

  2. 如何在linux下搭建svn服务

    • 安装svn 使用命令 yum install subversion 如果提示上述错误,请以管理员身份运行 使用命令su root 再执行 yum install subversion 2,查看sv ...

  3. Linux下搭建SVN服务器及自动更新项目文件到web目录(www)的方法

    首先搭建SVN服务器 1,安装SVN服务端 直接用apt-get或yum安装subversion即可(当然也可以自己去官方下载安装) sudo apt-get install subversion   ...

  4. Linux下搭建svn服务端

    安装 使用yum安装非常简单: yum -y install subversion (压缩包安装比这麻烦的多) Tortoise本是window下客户端工具,但也可以建仓库,作为服务端.Linux只有 ...

  5. Linux下搭建svn服务器(转)

    原文地址:http://blog.163.com/longsu2010@yeah/blog/static/173612348201202114212933/ 安装步骤如下: 1.yum install ...

  6. linux下搭建svn服务器

    安装步骤如下: 1.yum install subversion   2.输入rpm -ql subversion查看安装位置,如下图:   我们知道svn在bin目录下生成了几个二进制文件. 输入 ...

  7. SVN:linux下搭建svn服务器

    转载:https://www.cnblogs.com/puloieswind/p/5856326.html 1. 安装SVN服务器: 检查是否已安装 # rpm -qa subversion 安装SV ...

  8. linux下搭建SVN

      官网下载: http://subversion.apache.org/packages.html SVN客户端:TortoiseSVN :https://tortoisesvn.net/downl ...

  9. linux 下搭建svn

    Update 程序设计中的“后悔药”——SVN 一.历史起源 1.版本控制软件   答:主要是对源代码版本进行控制与管理 2.版本控制软件起源 CVS:最早期的开源的版本控制软件(开源奇葩) VSS: ...

随机推荐

  1. git clean 使用方法

    删除 一些 没有 git add 的 文件: git clean 参数 -n 显示 将要 删除的 文件 和  目录 -f 删除 文件,-df 删除 文件 和 目录 git clean -n git c ...

  2. jqueryEasyUI:tabs扩展:给tabs组件绑定双击事件 分类: JqueryEasyUI 2014-09-29 14:36 537人阅读 评论(0) 收藏

    实现代码: $.extend($.fn.tabs.methods, { /** * 绑定双击事件 * @param {Object} jq * @param {Object} caller 绑定的事件 ...

  3. C# XML操作

    一.简单介绍 using System.Xml; //初始化一个xml实例 XmlDocument xml=new XmlDocument(); //导入指定xml文件 xml.Load(path); ...

  4. 怎样打开64位 Ubuntu 的32位支持功能?

    转自:http://jingyan.baidu.com/article/7082dc1c539c15e40a89bd3e.html 大多数使用基于 Ubuntu/Debian 的发行版的人都更倾向于选 ...

  5. 深入分析JavaWeb 技术内幕

    1,通过浏览器请求一个资源,会发生以下几种过程 1) http的解析过程,包括对于http请求头和响应头中指令(控制用户浏览器的渲染行为和 服务器的执行逻辑)的解析 2)DNS的解析过程(根据域名获取 ...

  6. dojo.publish 和 dojo.subscribe

    原文链接:http://www.cnblogs.com/didi/archive/2010/06/13/1757894.html //dojo.publish 和 dojo.subscribe  :d ...

  7. Comet:基于 HTTP 长连接的“服务器推”技术解析

    原文链接:http://www.cnblogs.com/deepleo/p/Comet.html 一.背景介绍 传统web请求,是显式的向服务器发送http Request,拿到Response后显示 ...

  8. indeterminateDrawable

    Android原生控件只有横向进度条一种,而且没法变换样式,比如原生rom的样子很丑是吧,当伟大的产品设计要求更换前背景,甚至纵向,甚至圆弧状的,咋办,比如ok,我们开始吧: 一)变换前背景 先来看看 ...

  9. 【项目经验】EasyUI Tree

    ITOO5.0开始了,我参加了伟大的基础系统,从整体上来说,基础系统有三个职能: 1.自己的核心职能--选课(公共选修课,专业选修课),课表: 2.为其他系统提供真实数据: 3.维护信息 而近两三天, ...

  10. document对象(二)

    五.相关元素操作: var a = document.getElementById("id");                找到a: var b = a.nextSibling ...