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 ...
随机推荐
- 卸载Windows服务
在Windows中,有一类程序称为服务,在操作系统内核加载完成后就开始加载.这里程序往往运行在操作系统的底层,因此资源占用比较大.执行效率比较 高,比较有代表性的就是杀毒软件. 但是一旦因为特殊原因不 ...
- Fastreport使用经验(转)在Delphi程序中访问报表对象
Fastreport使用经验(转) 在Delphi程序中访问报表对象 最基本的方法就是frxReport1.FindObject. 然后把返回的对象强制转换成它的类型,当然,在报表中必须真的有这么个东 ...
- Java for LeetCode 059 Spiral Matrix II
Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For ...
- VirtualBox 虚拟 Ubuntu 的一些感想
之前有说过最近在学习Shell,公司及家里的电脑目前都是Windows系统,进行shell学习主要是用一些模拟linux环境的软件,比如banbun.cygwin banbun的功能很强大,集成了oh ...
- Eclipse中android工程C++文件中出现的莫名其妙的错误
大多数是std库相关的问题,例如 vector<int> v; v.push_back(23);//这句语法是没有错误的,但是每次执行Run As的时候就会报错 尝试1:在工程名右键-Cl ...
- native app
Apache Cordova是PhoneGap贡献给Apache后的开源项目,是从PhoneGap中抽出的核心代码,是驱动PhoneGap的核心引擎.你可以把他想象成类似于Webkit和Google ...
- android 输入法出现挤压屏幕、android输入键盘覆盖了屏幕控件的解决办法
如果希望输入法键盘弹出时不自动向上挤压activity,在Manifest清单文件中对应的activty中设置属性android:windowSoftInputMode="adjustPan ...
- JPush开发
主要功能 保持与服务器的长连接,以便消息能够即时推送到达客户端 接收通知与自定义消息,并向开发者App 传递相关信息 SDK集成步骤 1.导入 SDK 开发包到你自己的应用程序项目 解压缩 jpush ...
- Instruments_Activity Monitor使用入门
Activity Monitor,官方解释为:(活动监视器)即实时显示CPU.内存和网络的使用情况,记录由虚拟内存大小测量的系统负载.用一句大白话来说,Activity Monitor类似Window ...
- mysql优化总结
SQL优化目的: 降低响应时间 直接影响用户体验度 降低资源使用率 主要体现在IO和CPU上,网络.内存消耗 优化原则: 1.IN子查询改成JOIN2.NOT IN子查询改成LEFT JOIN3.消除 ...