svn的安装与使用

来源:互联网 发布:任亮java视频 编辑:程序博客网 时间:2024/04/30 03:57

1、安装SVN服务器

2、创建SVN服务端仓库

例如:svnadmin  create h:/svnServer/app/shop

3、svn客户端安装

4、svn客户端使用

4.1、开启svn服务

4.2、创建文件夹,右键checkout检出仓库文件,update更新创库文件

文件覆盖的解决:

① 给每个文件分配一个“令牌”,谁拿到令牌谁就有权利开发该文件

(同一个程序文件同一个时间点只允许有一个人开发)

② 给每个文件设置一个版本号码,提交的时候如果服务器的版本等于本地版本号码就允许提交,否则不允许提交(本地号码 小于  服务器版本)

 

冲突:

广义角度的冲突,提交程序文件本地版本号码 小于 服务器版本号码

狭义角度的冲突,多个程序员对同一个文件同一处代码的修改再共同提交文件的时候回产生冲突。


svn用户管理:

1、添加用户和密码

更改svn仓库文件下的svnserve.conf文件

[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 directory containing
### 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
### 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 the
### directory containing this file.  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 = My First Repository
2、更改passwd文件

[users]
# harry = harryssecret
# sally = sallyssecret
jack = 456238

3、更改authz文件

[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe

# [/foo/bar]
# harry = rw
# &joe = r
# * =

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

[shopjd:/]
jack = rw
* =


1 0