之前用过一次 但是没有真正的用起来 只是知道了一些基本概念

好了 决定开始真正的用这个svn了

参考大神http://www.cnblogs.com/wrmfw/archive/2011/09/08/2170465.html

搞来搞去发现其实是建立一个svn之后把每个项目都装在这个svn目录下的不同文件夹里(也是试出来的小领悟)

一切以实例为主,开始吧

我的svn目录建在 /home/user/svn/下

则先建立了这个文件夹后,在这下面建立svn目录结构

mkdir /home/user/svn
svnadmin create --fs-type fsfs /home/user/svn

之后,我以管理两个项目为例,一个叫pro_1,一个叫pro_2,他们分别在/home/user/projects/pro_1和/home/user/projects/pro_2下面。

svn mkdir file:///home/user/svn/pro_1 -m "Initial create pro_1 directory"
svn import /home/projects/pro_1 file:///home/user/svn/pro_1 -m "Initial import pro_1"
svn mkdir file:///home/user/svn/pro_2 -m "Initial create pro_2 directory"
svn import /home/projects/pro_2 file:///home/user/svn/pro_2 -m "Initial import pro_2"

这里有个小细节,就是在import的时候,是将pro_1/pro_2下的文件进行import,所以需要事先建好文件夹来import。

接着这两个文件已经搞定了,来开始配置不同文件的访问权限。在/home/user/svn下找到conf文件夹,下面开始来。

先改svnserve.conf,去掉所有有效的注释行,就可以了

### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository. (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.) ### 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",
### 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
### database file. Unless you specify a path starting with a /,
### the file's location is relative to the conf directory.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control. Unless you specify a path
### starting with a /, the file's location is relative to the conf
### directory. If you don't specify an authz-db, no path-based access
### control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa. The default realm
### is repository's uuid.
realm = Welcome to my svn

anon-access = read 代表的是未验证通过用户的权限;auth-access = write代表的是验证通过用户的权限;password-db = passwd代表的是用户名密码文件所在地址,通常就放在了conf文件夹下,就不用改了;authz-db = authz代表的是访问权限的配置文件所在地,默认也是在conf文件夹下,也默认不改,realm = Welcome to my svn就是默认的一个欢迎语,在访问的时候会出现,随意。

接着,来搞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]
root = root
tom = tom
helen = helen

大概就是这个意思,再来看authz

### 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, to a group of users defined in a special [groups]
### section, or to anyone using the '*' wildcard. Each definition can
### grant read ('r') access, read-write ('rw') access, or no access
### (''). [groups]
admin = root
user0 = tom
user1 = helen [/pro_1]
@admin = rw
@user0 = r
* = [/pro_2]
@admin = rw
@user1 = r
* =

这里的pro_1和pro_2是根据马上的开启svn服务器的指令相关的,反正意思就是pro_1可以root和tom访问,pro_2可以root和helen访问。

接下来开启svn服务器就好了

svnserve -d -r /home/user/svn

用户tom想要访问pro_1,则

svn ls svn://172.25.31.153/pro_1

好像第一次进入要输入用户名和密码,如果想要更换身份的话

svn ls svn://172.25.31.153/pro_2 --username helen --password helen

这个好像进入一次用这个用户名,接下来的访问都默认用这个身份,除非新的--username XXX --password XXX出现。

祝各位玩的顺利

【Umezawa's Jitte】真正用起来svn来管理版本的更多相关文章

  1. eclipse中搭建svn开发管理环境

    1.准备好资源 subversive,若是离线安装,已为大家准备好:http://pan.baidu.com/s/1hrbXH9y(本人喜欢离线安装,在线安装就不在此说了,其实只要一种方法简单的方法能 ...

  2. SVN分支管理策略个人见解

    本篇目录 前言 SVN分支管理策略 VisualSVN Server TortoiseSVN客户端 Repository的创建 Check out trunk创建新项目MyProject trunk更 ...

  3. 看svn用户组管理功能的产品设计

    我负责公司的svn配置.用了近一年了,今天饶有兴致,分享一下svn的用户组管理功能,这个产品设计值得借鉴,简单易用. svn用户组管理的功能描述:新建用户组,并给组分配成员用户:编辑用户组,包括修改组 ...

  4. svn还原到指定版本

    svn还原到指定版本 1,选中文件夹,右健,show log 2,选中指定版本,右健,Revert to this revision 3,svn commit 4,ok

  5. SVN权限管理

    转自:http://www.cnblogs.com/xingchen/archive/2010/07/22/1782684.html /******************************** ...

  6. 九步轻松实现SVN创建管理项目

    本节向大家描述一下在Windows上使用Subversion中如何使用SVN创建管理项目,在这里和大家分享一下,欢迎大家一起来学习在 使用SVN创建管理项目的方法.首先看一下SVN介绍. Subver ...

  7. svn的管理与维护要点—纯手工编写

    由于在公司要维护阿里云的linux服务器,我们的svn服务器就安在阿里云上面.所以经常会涉及到svn的维护操作.离职的时候编写交接文档,刚好有充足的时间写一篇说明介绍,此说明纯原创,不是从网上复制,手 ...

  8. Google免费的SVN服务器管理VS2010代码

    原文:Google免费的SVN服务器管理VS2010代码 前言 Google免费为我们提供了代码管理的SVN服务器.首先我这里用的Win7 64的电脑系统,用VS2010进行的代码开发.这里管理代码需 ...

  9. 多项目中SVN权限管理精辟解析

    本节和大家讨论一下多项目SVN权限管理,主要包括建立版本库,修改版本库配置文件,配置允许访问的用户,设置用户访问权限.下面我们就来看一下SVN权限管理.svn权限管理svn的权限管理涉及到一下文件:p ...

随机推荐

  1. 用 Java 实现断点续传参考 (HTTP)

    断点续传的原理 其实断点续传的原理很简单,就是在 Http 的请求上和一般的下载有所不同而已.        打个比方,浏览器请求服务器上的一个文时,所发出的请求如下:        假设服务器域名为 ...

  2. springboot 学习笔记(七)

    (七)springboot整合activemq,消息消费,以及发送对象消息 1.springboot整合activemq发送消息,上一节已经介绍了,现在要对消息队列中的内容进行处理,下面写一个cons ...

  3. 从零开始的全栈工程师——js篇2.4

    条件语句与循环语句 变量提升: 变量提升是浏览器的一个功能,在运行js代码之前,浏览器会给js一个全局作用域叫window ,window分两个模块,一个叫内存模块,一个叫运行模块,内存模块找到当前作 ...

  4. 学习笔记:SVG和Canvas

    SVG SVG 与 Flash 类似,都是用于二维矢量图形,二者的区别在于,SVG 是一个 W3C 标准,基于 XML,是开放的.因为是 W3C 标准,SVG 与其他的 W3C 标准,比如 CSS.D ...

  5. 跨平台移动开发phonegap/cordova 3.3全系列教程-简介

    一.   跨平台實現架構: phonegap +asp.net+jquery mobile/jqmobi 二.   PhoneGap简介 PhoneGap是一个开源的开发框架,用来构建跨平台的使用HT ...

  6. 软件License设计

    如何保护软件版权,最常用的办法就是设计一套license验证框架. 1.我们的常规需求如下: .可以限制软件只能在一台机器上使用: 目前很多软件都是一机一码的销售,软件换一台机器则不能使用,想要几台机 ...

  7. Bugzilla-5.0.3 (OpenLogic CentOS 7.2)

    平台: CentOS 类型: 虚拟机镜像 软件包: apache2.4.6 bugzilla5.0.3 mariadb5.5.47 perl5.16.3 apache bug tracking bug ...

  8. Node.js | 你的物联网系统,有个管家待认领

    很多时候,专业的事情都要交给专业的人来做,才会更放心. 例如买了套房,交房装修完毕,欢天喜地入住后,房子的日常养护和维护之类的事情,都由谁来负责呢? 物业呗~买了房子就自然需要房子所在小区提供的物业服 ...

  9. openlayers 初步认识(转)

    OpenLayers是一个开源的js框架,用于在您的浏览器中实现地图浏览的效果和基本的zoom,pan等功能.OpenLayers支持的地图来源 包括了WMS,GoogleMap,KaMap,MSVi ...

  10. World Wind Java开发之十二——加载粗制三维模型(ExtrudedPolygon)(转)

    ww可以根据DLG图批量生成假三维模型,这对于小区等特征相似的建筑物模型的构建是非常有用的.下面来看如何一步步实现假三维模型的加载: 1.Shp文件的制作 首先在arcmap下数字化几个建筑物,并新建 ...