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 ...
随机推荐
- Search a 2D Matrix | & II
Search a 2D Matrix II Write an efficient algorithm that searches for a value in an m x n matrix, ret ...
- iOS 定义圆角控件
ios7 以前,想把UILabel变为圆角的,只需要设置layer的 cornerRadius属性,ios7以后,还需要设置 masksToBounds = true. 以下是这个属性的说明 A Bo ...
- mysql 恢复备份
1.在my.cnf 文件中增加以下配置 log-bin=/var/lib/mysql/mysql-binloglog-bin-index = /var/lib/mysql/mysql-binlog 2 ...
- Java for LeetCode 140 Word Break II
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each ...
- sublime text 3 使用过程总结记录
自定义的设置: "save_on_focus_lost": true //在文件失去焦点的时候自动保存
- Step deep into GLSL
1 Lighting computation is handled in eye space(需要根据眼睛的位置来计算镜面发射值有多少进入眼睛), hence, when using GLSL (GP ...
- backslash and newline separated by space
原来是因为\ 后面多了一个空格 检查写的代码中将\后面的空格去掉就可以了.
- Android之ViewDragHelper
在自定义ViewGroup中,很多效果都包含用户手指去拖动其内部的某个View(eg:侧滑菜单等),针对具体的需要去写好onInterceptTouchEvent和onTouchEvent这两个方法是 ...
- PIGOSS
http://blog.sina.com.cn/s/blog_865bc4c60102wkb1.html
- Java Hour 61 基础概念拾遗
循环遍历器 for (Iterator iter = list.iterator(); iter.hasNext();) { int i = ((Integer) iter.next()).intVa ...