svn服务器配置
源代码版本维护
官方网站:http://subversion.apache.org/
Windows客户端 TortoiseSVN:http://tortoisesvn.net/
常见的版本控制软件
CVS,逐渐被SVN取代,是CVX重写版和改写版
SVN,Subversion
Git,Git是一个开源的分布式版本控制系统,用以有效、高速的处理从很小到非常大的项目版本管理。Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件
SVN存储数据的方式
BDB,Berkeley DB,一种事务安全型表类型
FSFS,"FSFS" 采用文件系统的方式, 替代原来的基于Berkeley DB的实现.
因为BDB方式在服务器中断时,有可能锁住数据,所以还是FSFS方式更安全一点
SVN的运行方式及端口
独立服务器 3690端口 访问方式SVN:// C/S模式
借助apache运行 80端口 访问方式 http://
安装svn:
[root@super67 ~]# yum install -y subversion
[root@super67 ~]# grep svn --color /etc/services
svn 3690/tcp # Subversion
svn 3690/udp # Subversion
存放版本库的主目录:
[root@super67 ~]# mkdir /myweb
创建两个版库:
[root@super67 ~]# svnadmin create /myweb/www.xiaofan.com
[root@super67 ~]# svnadmin create /myweb/www.xiaofan.cn
版本库文件介绍:
[root@super67 ~]# ll /myweb/www.xiaofan.com/
total 24
drwxr-xr-x 2 root root 4096 Sep 25 09:54 conf #创库的配置文件(账号、权限等)
drwxr-sr-x 6 root root 4096 Sep 25 09:54 db #版本库数据存放位置
-r--r--r-- 1 root root 2 Sep 25 09:54 format #当前文件库配置的版本号
drwxr-xr-x 2 root root 4096 Sep 25 09:54 hooks #放置hook脚本的位置
drwxr-xr-x 2 root root 4096 Sep 25 09:54 locks #放置subversion锁定数据的目录,追踪存取文件库的客户端
-rw-r--r-- 1 root root 229 Sep 25 09:54 README.txt
dav目录:是提供apache与mod_dav_svn使用的目录,让他们存储内部数据,刚开始新建时此目录没有
conf目录文件:
[root@super67 ~]# ll /myweb/www.xiaofan.com/conf/
total 12
-rw-r--r-- 1 root root 1080 Sep 25 09:54 authz #认证权限
-rw-r--r-- 1 root root 309 Sep 25 09:54 passwd #用户名和密码
-rw-r--r-- 1 root root 2279 Sep 25 09:54 svnserve.conf #服务器配置文件
修改配置文件:
[root@super67 ~]# grep -Ev "^$|^#" /myweb/www.xiaofan.com/conf/svnserve.conf
[general]
anon-access = read #匿名用户可以读,使用none的话就是匿名用户不可以访问
auth-access = write #认证用户可以写,可以是read,write,none
password-db = passwd #密码库文件,默认使用的是同一目录下的passwd文件作为用户密码库
authz-db = authz #认证权限文件
realm = www.xiaofan.com #登陆提示信息
[sasl]
[root@super67 ~]# grep -Ev "^$|^#" /myweb/www.xiaofan.com/conf/passwd
[users] #定义用户、密码
xiaofan = 123456
tt = 1234567
user = 12345678
[root@super67 ~]# grep -Ev "^$|^#" /myweb/www.xiaofan.com/conf/authz
[aliases]
[groups]
Check = xiaofan,tt #定义组
[/] #/表示我当前所在版本库目录
user = rw # user 用户有读写权限
@Check = r #@Check表示这个组的权限,就是上面定义的组的成员
* = #除了上面的有赋予权限成员之外,其他的成员都没有权限
SVN目录格式:
[/目录名]
@用户组名 = 权限
用户名 = 权限
* =
启动svn:
[root@super67 ~]# svnserve -d -r /myweb/
导入本地代码:
[root@super67 ~]# mkdir svn_local
[root@super67 ~]# cd svn_local/
[root@super67 svn_local]# touch 1.jsp 2.jsp 3.jsp
[root@super67 svn_local]# svn import /root/svn_local/ file:///myweb/www.xiaofan.com/ -m "one"
Adding /root/svn_local/1.jsp
Adding /root/svn_local/2.jsp
Adding /root/svn_local/3.jsp
Committed revision 1.
客户端提交代码:
[root@super67 svn_client]# touch 4.jsp 5.jsp
[root@super67 svn_client]# svn import /root/svn_client/ svn://192.168.1.67/www.xiaofan.com/ -m "two"
Authentication realm: <svn://192.168.1.67:3690> www.xiaofan.com
Password for 'root':
Authentication realm: <svn://192.168.1.67:3690> www.xiaofan.com
Username: user
Password for 'user': 12345678
-----------------------------------------------------------------------
ATTENTION! Your password for authentication realm:
<svn://192.168.1.67:3690> www.xiaofan.com
can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details.
You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/root/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? no
Adding /root/svn_client/5.jsp
Adding /root/svn_client/4.jsp
Committed revision 2.
[root@super67 svn_client]#
下载代码:
[root@super67 ~]# svn checkout svn://192.168.1.67/www.xiaofan.com svn_download
Authentication realm: <svn://192.168.1.67:3690> www.xiaofan.com
Password for 'user':
Authentication realm: <svn://192.168.1.67:3690> www.xiaofan.com
Username: xiaofan
Password for 'xiaofan':
-----------------------------------------------------------------------
ATTENTION! Your password for authentication realm:
<svn://192.168.1.67:3690> www.xiaofan.com
can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details.
You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/root/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? no
A svn_download/5.jsp
A svn_download/1.jsp
A svn_download/2.jsp
A svn_download/3.jsp
A svn_download/4.jsp
Checked out revision 2.
checkout:
check out导出获得文件后,导出的文件仍处于SVN版本控制中,与版本库保持关联,
比如你可以进行Svn Update或者Svn Commit操作,checkout是第一次用,后面的用法就是更新
修改、添加代码:
[root@super67 ~]# cd svn_download/
[root@super67 svn_download]# ls
1.jsp 2.jsp 3.jsp 4.jsp 5.jsp
[root@super67 svn_download]# cat 5.jsp
#
555555555
[root@super67 svn_download]# touch 6.html
[root@super67 svn_download]# svn add 6.html
A 6.html
[root@super67 svn_download]# svn add 5.jsp
svn: warning: '5.jsp' is already under version control
[root@super67 svn_download]# svn commit -m "three"
Authentication realm: <svn://192.168.1.67:3690> www.xiaofan.com
Password for 'xiaofan':
Authentication realm: <svn://192.168.1.67:3690> www.xiaofan.com
Username: user
Password for 'user': 12345678
-----------------------------------------------------------------------
ATTENTION! Your password for authentication realm:
<svn://192.168.1.67:3690> www.xiaofan.com
can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details.
You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/root/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? no
Sending 5.jsp
Adding 6.html
Transmitting file data ..
Committed revision 3.
add 功能:
向文件拷贝所在的文件夹中添加新的文件,并作出标识,是新添加的,
下一步提交时将一并提交到Subversion版本库中去。
简单的说就是将一新文件加入svn,你添加再提交后该文件就进入subversion版本中去了;
常见的选项:
import:将未版本化的文件纳入版本控制并提交
checkout:从版本库中检出一个修订版
update:更新工作拷贝
add,delete,copy, move:增、删、复制、移动文件或目录
status:检查状态差异
diff:检查文件行级详细差异
revert:恢复
resolve:解决冲突
switch:切换工作拷贝对应的版本库分支
log:查看历史记录
list:显示文件目录
cat:查看某个文件内容
svn服务器配置的更多相关文章
- linux下SVN服务器配置
SVN服务器配置 1. 安装svn服务 yum install subversion 2. 新建一个目录用于存储SVN所有文件 mkdir /home/svn 3. 创建项目 在上面创建的文件夹中为项 ...
- SVN服务器配置实战
[需求] 为公司多个部门建立的SVN仓库compay 公司部门和人员构成 A部门 (zhangsan,lisi,wanger,mazi) B部门(jia,yi,bing,ding) C部门(chun, ...
- Windows基于Apache的svn服务器配置
参照 http://bbs.iusesvn.com/thread-158-1-1.html文章,经过svn的洗刷,终于把它配置成功,现在把我所配置的方法,记录下来,以供其他有需要的朋友参考,需要改进的 ...
- Windows 下 SVN 服务器配置
1.下载文件, 下载最新版本subversion,我这里选择VisualSVN-Server-2.5.7.exe 2.安装Subversion 服务器 由于我下载的是setup.exe版本 ...
- svn服务器配置小记
在这里/opt/svndata/repos1创建svn版本库svnadmin create /opt/svndata/repos1 创建成功后会在/opt/svndata/repos1目录下生成con ...
- svn服务器配置与客户端的使用
1, Apache Subversion 官网下载地址: http://subversion.apache.org/packages.html#windows 官网下载提供的一般都是最新版本的,如果想 ...
- svn服务器配置以及自动同步到web服务器
感觉再不用svn就真的老了. 安装 yum install subversion 新建repo mkdir -p /opt/svn/myrepo svnadmin create /opt/svn/my ...
- svn服务器配置 for mac
本文转载至 http://blog.sina.com.cn/s/blog_5e42f31a010156z4.html 1.找到合适的目录,新建一个版本库的目录:mkdir svn 创建版本库:sv ...
- 简述SVN服务器配置和客户端操作
有关SVN服务器的搭建见:http://www.cnblogs.com/DwyaneTalk/p/3997688.html 搭建好环境之后,服务器端需要完成如下操作: 1.需要新建Repository ...
随机推荐
- Power of Two & Power of Three & Power of Four
Check Power of 2 Using O(1) time to check whether an integer n is a power of 2. Example For n=4, re ...
- Java for LeetCode 058 Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the l ...
- HDU 4334 Trouble (暴力)
Trouble Time Limit: 5000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u Submit Statu ...
- CSS-Transform-transition-Animation
Transform 根据我的理解,transform和width.height.background一样,都是dom的属性,不同的是它是css3旗下的,比较屌,能够对原来的dom元素进行移动.缩放.转 ...
- Android之canvas详解
首先说一下canvas类: Class Overview The Canvas class holds the "draw" calls. To draw something, y ...
- 批量update
参见http://lj.soft.blog.163.com/blog/static/7940248120109215191358/ 例子:update CarSeriesDetail set clic ...
- oracle 10g 学习之函数和存储过程(12)
一.函数 1. 函数的 helloworld: 返回一个 "helloworld--!" 的字符串 create or replace function helloworld re ...
- oracle 共享池( shared pool )
Oracle共享池 Oracle共享池(Share Pool)属于SGA,由库高速缓存(library cache)和数据字典高速缓存(data dictionary cache)组成. 库高速缓存 ...
- hdu 4268 multiset+贪心
Alice和Bob有n个长方形,有长度和宽度,一个矩形可以覆盖另一个矩形的条件的是,本身长度大于等于另一个矩形,且宽度大于等于另一个矩形,矩形不可旋转,问你Alice最多能覆盖Bob的几个矩形? /* ...
- DHCP和NAT的概念与对比
转自:http://network.51cto.com/art/201009/223440.htm 在网络协议中,DHCP和NAT的使用非常普遍.那么对于这两个协议你是否有所掌握呢?这里我们针对这两方 ...