1.版本控制是指对软件开发过程中各种程序代码,配置文件及说明文档等文件变更的管理,是软件配置管理的核心思想之一。


2.常用的版本控制工具: gitlab subversion


3.gitlab部署

//配置yum源
[root@lanzhiyong ~]# cd /etc/yum.repos.d/
[root@lanzhiyong yum.repos.d]# curl -o 163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
[root@lanzhiyong yum.repos.d]# sed -i 's/\$releasever/7/g' /etc/yum.repos.d/163.repo
[root@lanzhiyong yum.repos.d]# sed -i 's/^enabled=.*/enabled=1/g' /etc/yum.repos.d/163.repo

//安装依赖包
[root@lanzhiyong ~]# yum -y install epel-release
[root@lanzhiyong ~]# yum -y install epel-release git
[root@lanzhiyong ~]# yum -y install curl openssh-server openssh-clients postfix cronie policycoreutils-python

//启动postfix服务并设置开机自启
[root@lanzhiyong ~]# systemctl restart postfix
[root@lanzhiyong ~]# systemctl enable postfix

//下载gitlabd 的rpm包
[root@lanzhiyong ~]# cd /usr/src/
[root@lanzhiyong ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/y um/el7/gitlab-ce-11.2.1-ce.0.el7.x86_64.rpm

//安装gitlab
[root@lanzhiyong src]# rpm -ivh gitlab-ce-11.2.1-ce.0.el7.x86_64.rpm 

//修改配置文件
[root@lanzhiyong src]# vim /etc/gitlab/gitlab.rb 
………………
external_url 'http://192.168.209.12' #将此处设为gitlab的服务器IP地址或者域名 
………………

//重载配置文件并重启gitlab
[root@lanzhiyong src]# gitlab-ctl reconfigure
[root@lanzhiyong src]# gitlab-ctl restart

//查看当前的gitlab版本
[root@lanzhiyong src]# head -1 /opt/gitlab/version-manifest.txt
gitlab-ce 11.2.1

//设置管理员密码
[root@lanzhiyong ~]# gitlab-rails console production
user = User.where(id: 1).first             //id为1的是超级管理员
user.password = 'lanzhiyong'          //密码必须至少8个字符
user.save!                        //保存修改,若无问题将返回true
exit

4.gitlab管理 在浏览器中使用gitlab服务器的IP访问,页面如下图所示: