SVN进行代码的托管
svn 使用的是集中服务器 就是只有一个服务器的意思
git 是分布式服务器
服务器:
存储客户端上传的源代码。
可以在Windows上通过安装 Visual SVN Sever 。
客户端:
上传代码到服务器,或者更新服务器的代码到本地,保持同步。
服务器的搭建:
在windows系统上可以安装 VisualSVNSever 或 TortoiseSVN 软件来搭建 Svn 环境,由于Mac自带了svn的服务器端和客户端功能,所以我们可以在不装任何第三方软件的前提下使用svn功能,不过还需做一下简单的配置。
进入 SVN China 官网注册账号。
1.建立连接,就是添加自己的链接,建立自己的项目本地路径,保证开发者在一个服务上面。
2.项目经理把框架 import 到服务器上,组长就可以把自己电脑上的本地的服务器框架删掉。
3.团队个人从服务器上获取框架, check out
4.分别编码(切记重要的是,不要多人去修改一个文件<有可能是在以前过期的版本上修改,会不能成功,这时候要 组员商定后 点 resolve 解决按钮>)
5.上传自己的代码,commit
6.其他人去更新代码 update
其他按钮的按钮的作用:
compare With HEAD 会出现两个面板,服务器上的代码,与本地我的代码是否存在没有更新的东西。如果发现不一样就赶快 Update
log 就是我们在提交的时候,修改的时候打上去的注释,用于记录修改原因,版本,以及其他的说明
translation 能把你今天对框架里面做了什么操作,都显示出来,上传了什么代码?下载了什么代码?修改了什么代码?
在这个SVn 里面本地的文件是操作的副本,只有上传到Svn 服务器上的才是真正的框架原本(*这里要注意一下,所以我们在更新一下真正的之后就可以把本地的删除)
下面简单的操作一下使用 SVN 进行完成项目的管理工作。
在Mac环境下搭建svn服务器端环境。
1、创建代码仓库,用来存储客户端所上传的代码。
先在电脑的账户目录下面建一个文件夹 Svn Repositories 用来存储所有 svn 管理的代码仓库。操作如下
MACdeMacBook-Pro:SvnRepositories mac$ cd /Users/mac/SvnRepositories\
MACdeMacBook-Pro:SvnRepositories mac$ svnadmin create /Users/mac/SvnRepositories/mycode
svnadmin: E000002: Repository creation failed
svnadmin: E000002: Could not create top-level directory
svnadmin: E000002: Can't create directory '/Users/mac/SvnRepositories/mycode': No such file or directory
MACdeMacBook-Pro:SvnRepositories mac$
上面的错误是因为不能再一个同名的文件夹中创建一个同名的仓库的原因。
MACdeMacBook-Pro:SvnRepositories mac$ svnadmin create /Users/mac/svn/repository
svnadmin: E000002: Repository creation failed
svnadmin: E000002: Could not create top-level directory
svnadmin: E000002: Can't create directory '/Users/mac/svn/repository': No such file or directory
MACdeMacBook-Pro:SvnRepositories mac$
上面的命令也是错误的,原因是在创建的时候确保已经svn/repository已经存在,上面的错误就是我没有创建svn/repository造成的
如果在终端输入svnadmin create /Users/mac/svn/repository 代码,无提示说明创建成功,如下图所示:
在账户下面可以看到 svn下面有个 erpository 代码仓库。
配置 svn 用户权限/Users/mac/svn/repository/conf/目录下存在3个文件: authz、passwd、snvserve.conf
你可以选择使用文本编辑打开,也可以使用终端打开
1.打开 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,
### - a group of users defined in a special [groups] section,
### - an alias defined in a special [aliases] section,
### - all authenticated users, using the '$authenticated' token,
### - only anonymous users, using the '$anonymous' token,
### - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### (''). [aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average # 用户组
[groups]
# admins是组名,admin是组员,可以写多个,用”,“分隔.如admins=admin,master
admins=admin # harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe # [/foo/bar]
# harry = rw
# &joe = r
# * = # 设置/目录权限
[/] # 这里的意思是admins组的成员都有rw的权限,rw是读写得权限,也可以写成admin=rw,只赋予某一个用户有读写权限
@admins=rw # 这里如果不写的意思是,下一级目录的用户不具备继承关系,也就是没有访问/的权限,* = r,就是别>的用户只能远观了, * = rw,就让其他的用户也有继承关系了,就是也可具备读写权限
* = # [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
2、打开 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] # authz 的用户名对应起来,后面是用户密码
admin=123456 # harry = harryssecret
# sally = sallyssecret
3、打开 svnserve.conf 文件夹,然后再修改为如下:(svn 的配置信息)
### 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.apache.org/ for more information. [general]
### The anon-access and auth-access options control access to the
### repository for unauthenticated (a.k.a. anonymous) users and
### authenticated users, respectively.
### Valid values are "write", "read", and "none".
### Setting the value to "none" prohibits both reading and writing;
### "read" allows read-only access, and "write" allows complete
### read/write access to the repository.
### The sample settings below are the defaults and specify that anonymous
### users have read-only access to the repository, while authenticated
### users have read and write access to the repository. # anon-access = read 匿名用户有读写权限
# 禁用匿名用户读的权限 (read 改为 none)
anon-access = none # 登录用户的写的权限
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. # 这里需要放开注释,关联passwd.
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
### directory containing this file. The specified path may be a
### repository relative URL (^/) or an absolute file:// URL to a text
### file in a Subversion repository. 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
authz-db = authz ### The groups-db option controls the location of the file with the
### group definitions and allows maintaining groups separately from the
### authorization rules. The groups-db file is of the same format as the
### authz-db file and should contain a single [groups] section with the
### group definitions. If the option is enabled, the authz-db file cannot
### contain a [groups] section. Unless you specify a path starting with
### a /, the file's location is relative to the directory containing this
### file. The specified path may be a repository relative URL (^/) or an
### absolute file:// URL to a text file in a Subversion repository.
### This option is not being used by default.
# groups-db = groups
### 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
### The force-username-case option causes svnserve to case-normalize
### usernames before comparing them against the authorization rules in the
### authz-db file configured above. Valid values are "upper" (to upper-
### case the usernames), "lower" (to lowercase the usernames), and
### "none" (to compare usernames as-is without case conversion, which
### is the default behavior).
# force-username-case = none
### The hooks-env options specifies a path to the hook script environment
### configuration file. This option overrides the per-repository default
### and can be used to configure the hook script environment for multiple
### repositories in a single file, if an absolute path is specified.
### Unless you specify an absolute path, the file's location is relative
### to the directory containing this file.
# hooks-env = hooks-env [sasl]
### This option specifies whether you want to use the Cyrus SASL
### library for authentication. Default is false.
### This section will be ignored if svnserve is not built with Cyrus
### SASL support; to check, run 'svnserve --version' and look for a line
### reading 'Cyrus SASL authentication is available.'
# use-sasl = true
### These options specify the desired strength of the security layer
### that you want SASL to provide. means no encryption, means
### integrity-checking only, values larger than are correlated
### to the effective key length for encryption (e.g. means -bit
### encryption). The values below are the defaults.
# min-encryption =
# max-encryption =
下面我们开始启动服务器,命令如下所示:
svnserve 启动svn服务; -d 标示svnserve将会作为一个服务程序运行在后台 -r 标示将/Users/mac/svn/repository/作为根目录(网络搜索的,忘求证)
向svn库导入一个根目录
不能连接上上面的 svn 本地服务器,这是怎么回事啊?后来我将服务器后面添加了一个 5555 的端口,结果访问服务器,还是不能导入根目录成功。
后来打开了上面配置的三个svn本地服务器的文件,检查了一下,是原来是在每一个设置的行前面有空格,我把空格去掉就可以了。测试能够连接成功了。( 主要是 svnserve.conf 文件里面,的有效设置行都要定投写,svn服务器的配置相当比较敏感空格)链接
参照 链接 的博客没有实验成功在终端里向服务器里添加一个 svnroot 根目录。 《后期有时间了再搞一下吧,这里先笔记到此》
下面是直接实验使用 CornerStone 工具来进行检出、修改、提交代码。
1、新建一个 Repository
2. 配置svn server
3. 等待片刻,提示成功,显示一下界面
svn服务器用户的权限管理
SVN进行代码的托管的更多相关文章
- 安卓程序代写 网上程序代写[转]SVN 在线代码托管工具
本文转载自 : http://blog.csdn.net/ithomer/article/details/8142920 作者:阳光岛主 在互联网环境使用SVN服务,你必须要有一台在互联网环境内支持 ...
- svn 提交代码报错
svn 提交代码报错 最近新安装了TortoiseSvn 1.92,在上传代码,其中有新增加的文件,出现如下错误: 解决方法: 1.用vs生成patch文件 2.生成的patch文件中讲nonexis ...
- ios 开发中使用SVN管理代码
今天新公司需要使用SVN管理代码,就在网上查看相关的资料,现在把相关用法记录下来: 1.使用的是这个软件Cornerston 网上有很多相应的下载链接,可以去查看 2.下载安装之后,首先需要添加仓库r ...
- svn查看代码作者的命令
svn blame **.java | grep ** svn查看代码作者的命令
- 【技术贴】解决myeclipse SVN 提交代码 commit:remains in tree-conflict错误的解决办法
[技术贴]解决myeclipse SVN 提交代码 commit:remains in tree-conflict错误的解决办法 错误是:Aborting commit: xxxxx’ remains ...
- 【技术贴】解决myeclipse SVN 提交代码 commit:remains in tree-c
[技术贴]解决myeclipse SVN 提交代码 commit:remains in tree-conflict错误的解决办法 错误是:Aborting commit: xxxxx' remains ...
- ubuntu svn下载代码出错
ubuntu svn下载代码出错: svn: OPTIONS of 'https://server.domain.local/svn/repo': SSL handshake failed: SSL ...
- 微信开发之SVN提交代码与FTP同步到apache的根目录
SVN是协同开发的,版本控制器,就是几个人同时开发,可以提交代码到SVN服务器,这样就可以协同开发,一般是早上上班首先更新下代码,然后自己修改代码 工作一天之后,修改代码之后,下班之前,更新代码,然后 ...
- svn 更新代码
SVN 更新代码 --force # 强制覆盖 /usr/bin/svn --username user --password passwd co $Code ${SvnPath}src/ # 检出整 ...
随机推荐
- 2018.11.6 PION 模拟赛
期望:100 + 40 + 50 = 190 实际:60 + 10 + 50 = 120 考得好炸啊!!T1数组开小了炸掉40,T2用 int 读入 long long ,int存储 long lon ...
- 多个Nginx如何实现集群(没具体方案,只是初步探究)
场景: Nginx+Web服务器可以实现负载均衡,但是一台Nginx也是有限的,如果并非量高的话,在他的上层如何实现负载均衡. 如果是DNS或者CDN的话,建多个机房,势必有多个机房数据同步的问题. ...
- [UnityUI]一些有趣的UI样例
1.环形进度条 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/d ...
- UVA 1356 - Bridge(自适应辛普森)
UVA 1356 - Bridge option=com_onlinejudge&Itemid=8&page=show_problem&category=493&pro ...
- <bgsound> - 背景音乐
摘要 项目 说明 形式 <bgsound src="..."> 支持 e2+ 标签省略 开始标签:必须,结束标签:无 ■ 说明 bgsound 是 background ...
- oracle死锁解决经常用法(屡试不爽)
--1.查询被锁的情况 select object_name,machine,s.sid,s.serial# from v$locked_object l,dba_objects o ,v$sessi ...
- DASH----Desktop and mobile Architecture for System Hardware----桌面和移动系统硬件架构(DASH)计划
http://baike.baidu.com/subview/813787/11301142.htm http://sites.amd.com/cn/business/it-solutions/man ...
- cocos2d-x 3.0 touch事件官方解释
官方解释 http://www.cocos2d-x.org/docs/manual/framework/native/input/event-dispatcher/zh#_1
- RC4算法的Python实现详注
刚对RC4算法进行了学习,网上发现https://ju.outofmemory.cn/entry/46753 中作者展示了RC4的python实现,但代码缺乏注释,较为晦涩,因此本文对部分代码进行了注 ...
- 翻译:A Tutorial on the Device Tree (Zynq) -- Part V
A Tutorial on the Device Tree (Zynq) -- Part V Application-specific data 之前提过,设备树中是一些特殊信息,这样一个驱动可以管理 ...