版本控制介绍
版本控制是指对软件开发过程当中各类程序代码,配置文件及说明文档等文件变动的管理,是软件配置管理的核心思想之一。python
版本控制最主要的功能就是追踪文件的变动。git
版本控制的另外一个重要功能是并行开发。软件开发每每是多人协同做业,版本控制能够有效地解决版本的同步以及不一样开发者之间的开发通讯问题,提升协同开发的效率。vim
版本控制是软件配置管理的核心功能。浏览器
经常使用的版本控制工具:
gitlab服务器
subversionssh
gitlab部署 //配置yum源 [root@yanyinglai ~]# cd /etc/yum.repos.d/ [root@yanyinglai yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo [root@yanyinglai ~]# sed -i 's/\$releasever/7/g' /etc/yum.repos.d/CentOS7-Base-163.repo [root@yanyinglai ~]# sed -i 's/^enabled=.*/enabled=1/g' /etc/yum.repos.d/CentOS7-Base-163.repo [root@yanyinglai ~]# yum -y install epel-release //安装git [root@yanyinglai ~]# yum -y install epel-release git //安装依赖包 [root@yanyinglai ~]# yum -y install curl openssh-server openssh-clients postfix cronie policycoreutils-python //启动postfix服务并设置开机自启 [root@yanyinglai ~]# systemctl restart postfix [root@yanyinglai ~]# systemctl enable postfix 下载gitlab的rpm包 [root@yanyinglai ~]# cd /usr/src/ [root@yanyinglai src]# ls debug kernels [root@yanyinglai src]#wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.2.1-ce.0.el7.x86_64.rpm [root@yanyinglai ~]# cd /usr/src/ [root@yanyinglai src]# ls debug kernels [root@yanyinglai src]# ls debug gitlab-ce-11.2.1-ce.0.el7.x86_64.rpm kernels //安装gitlab [root@yanyinglai src]# rpm -ivh gitlab-ce-11.2.1-ce.0.el7.x86_64.rpm //修改配置文件 [root@yanyinglai ~]# vim /etc/gitlab/gitlab.rb external_url 'http://192.168.47.2' //将此处设为gitlab的服务器ip地址或域名 //重载配置文件并重启gitlab [root@yanyinglai ~]#gitlab-ctl reconfigure [root@yanyinglai ~]#gitlab-ctl restart //查看当前的gitlab版本 [root@yanyinglai ~]# head -1 /opt/gitlab/version-manifest.txt gitlab-ce 11.2.1 //设置管理员密码 [root@yanyinglai ~]# gitlab-rails console production irb(main):003:0* user = User.where(id: 1).first #id为1的是超级管理员 => #<User id:1 @root> irb(main):004:0> irb(main):005:0* user.password = '88888888' #密码必须至少8个字符 => "yanyinglai123" irb(main):006:0> user.save! #保存修改 Enqueued ActionMailer::DeliveryJob (Job ID: b80ac7d8-afe9-43a7-a4dd-c839cb0fd734) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/1 => true irb(main):007:0> exit #退出
3.gitlab管理
在浏览器中使用gitlab服务器的ip访问,页面以下图所示curl
管理页面以下图所示ide