代码管理平台常识
代码管理平台就是实现版本控制的软件,为了以后网站、项目等代码版本控制的简便,需要搭建一个代码管理平台。
1、代码管理工具发展简史
版本控制:记录若干文件内容变化,以便将来查阅特定版本修订情况。
版本管理工具发展简史,CVS→SVN→Git
参考(如需详细,可以参考此网址):
http://luckypoem14.github.io/test/2012/04/24/scm-history/
2、svn与git的开端
SVN全称subversion,是一个开源版本控制系统,始于2000年。
Git是Linux创始人Linus发起的,2005年发布,最初目的是更好管理Linux内核代码。
3、SVN与Git的区别
Git和SVN不同在于Git不需要依赖服务端就可以工作,即Git是分布式的。
关于Git和SVN的比较:
http://blog.lishiming.net/?p=305
4、简单了解GitLab与GitHub
GitHub是基于Git的在线Web页面代码托管平台,可以选择付费服务。
GitLab可以认为是一个开源的GitHub,两者没有直接关系。
SVN的安装与使用
服务端:192.168.200.10
客户端:192.168.200.40
服务端安装:
1、安装SVN
[root@localhost ~]# yum install -y subversion
在这篇中,我用的是本地yum源
[root@localhost ~]# mv /etc/yum.repos.d/C* /media/
[root@localhost ~]# mkdir /opt/centos
[root@localhost ~]# mount /dev/cdrom /opt/centos
mount: /dev/sr0 is write-protected, mounting read-only
[root@localhost ~]# vi /etc/yum.repos.d/local.repo
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
[root@localhost ~]# yum clean all
[root@localhost ~]# yum repolist
2、创建版本库
[root@localhost ~]# mkdir -p /data/svnroot/myproject
[root@localhost ~]# svnadmin create /data/svnroot/myproject/
[root@localhost ~]# cd !$
cd /data/svnroot/myproject/
3、修改配置文件
[root@localhost myproject]# cd conf/
[root@localhost conf]# vi 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]
# harry_and_sally = harry,sally
# h