您的位置:首页 > 其它

svn版本控制要总结的点

2012-07-25 11:38 225 查看
1.svn server 端的安装的前提是必须要安装 apache http软件的,为什么呢? because SUBVERSION 是 apache下的项目,apache为他提供了整合http,https等协议。

信息来源:

In November 2009, Subversion was accepted into Apache Incubator, which is the first step for open source projects to become a fully-fledged Apache Software Foundation project. In February 2010, it became just that, an Apache Software Foundation project.

2.svn的所存在的问题

like anything, it has its downsides, one of which is its speed. If you’re working with a remote repository and you need to commit your files and you happen to be using a slow Internet connection, you are be waiting a long time.



安装与基本应用

1.svn安装(分成两种):

apt-get install :

Sudo apt-get update
Sudo apt-get install subversion libapache2-svn



source code version

2. 创建仓库与仓库的文件权限

Sudo mkdir /var/svn-repos/

Sudo groupadd subversion

Sudo chown -R www-data:subversion /var/svn-repos/* 【仓库的用户属于apache用户(www-data),而组依然为svn: 保证了http可以整合svn,同时安全】
Sudo chmod -R 770 /var/svn-repos/* 【所属组必须有写入权限】

3. 创建工程与规划

Sudo svnadmin create --fs-type fsfs /var/svn-repos/project_test

Sudo svn mkdir -m "initial setup" file:///var/svn-repos/project_test/trunk
Sudo svn mkdir -m "initial setup" file:///var/svn-repos/project_test/branches
Sudo svn mkdir -m "initial setup" file:///var/svn-repos/project_test/tags

TIPS:You’ll also be adding the trunk, branches, and tags directories into the repositories here to ensure the repository is in the correct format(FSFS的格式,默认是DB的格式).

4. start svn server

svnserve -d –r /var/svn-repos/

-d : 指定要开启的目录

-r : 在后台运行

5. 关闭svn服务

SVN的进程名: svnserve

查找svn相关的PID值: ps aux |grep svnserve

kill –9 PID值

或者

killAll -9 svnserve

配置相关

1. 分配用户名以及密码.

1.在conf目录下打开svnserve.conf 文件,将匿名用户访问关闭【删除注释之后,一定不要留下空格】 anon-access = none

[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
#anon-access = write
#auth-access = write
#auth-access = none
anon-access = none【关键】[/code]
【no left or remain white space in this configuration file when you remove the single comment】

2.开启passwd文件,让配置文件引用这个密码文件

### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd【关键】[/code]

3. open passwd file in config dirctory,you can add new username and password

loin = 123456

值得注意的是:

1.anon-access = read —-正确

anon-access = read —-错误
这些配置在去除注释之后,一定要不留空格,否则会出现svnserve.conf:12: Option expected 的错误。
2. 用户名与密码两边必须有空格来隔开;当没有注释时,用户名前面一定不要留有空格



2. 为SVN工作目录分配相应的权限


svn的权限分配可以有点多种方案:基于组的分配 或者是个个用户的分配。不管哪一种,都必须要开启authz文件

1.在svnserve.conf文件中,把authz相关的注释信息删除

2. open authz file with your favorite editor,确定你需要进行权限分配的目录,使用r(read)与w(write)来进行权限的分配

[/share]
kaiwen = rw
jennifer = rw

3.在配置文件中,有着很多的情况,是需要考虑的:

针对某一个目录,组的成员拥有相同的权限,但是想给其中一个组用户以更高的权限
某一个用户可以查看根目录下的所有项目,但是只能checkout根目录下其中的一个目录,其它的目录均不允许访问或者是查看【或者是整个目录下的子项目都可以read,但是只有一个项目允许write】



一个基本svn trunk的结构


/trunk/website/cms
/trunk/website/e-commerce
/trunk/website/bbs
/trunkc/website/blog
/trunk/mobile/mobile-webiste
/trunk/mobile/app
/trunk/prototype
/trunk/graphic
/trunk/sketch


环境描述:


1.技术总监 【可以查看并且修改所有人的代码】

2. 三名team leader(一名为e-commerce,一名为cms 与blog,另一名为mobile) 【只负责各个的项目】

3. 各有3-5个下属人员(其中各个组均有一名主程序员) 【对于已经分配给自己的项目可以进行任意操作,但是对于他人的项目只能查看】

4. 一名产品经理 【只允许看prototype与design】

5. 一名项目经理 【可以查看多个独立组的项目,也可以修改设计,开发组的项目】



SVN的安全配置

SVN的布局规划

3. 多仓库的SVN配置(一个为代码,另一个为日志存储等)?

4. Subversion 整合 apache来实现http形式访问(包括https)

5. 如何来创建branch去分离项目(branch的意义)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: