环境准备
最小化安装的CentOS7
资源下载
Gitlab官网文档
https://about.gitlab.com/installation/
#清华镜像站下载
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.8.2-ce.0.el7.x86_64.rpm
安装Gitlab
#安装所需依赖
yum -y install curl policycoreutils-python openssl-server cronie
yum -y install postfix
systemctl start postfix
systemctl enable postfix
#安装Gitlab
rpm -ivh ./gitlab-ce-10.8.2-ce.0.el7.x86_64.rpm
##未下载rpm包,或者需安装最新版本可使用yum在线安装
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ce
运行Gitlab
#初始化Gitlab
gitlab-ctl reconfigure
#启动Gitlab
gitlab-ctl start
#浏览器访问IP地址,设置密码进行登录
#登录成功后进入Gitlab首页
#绑定域名之后即可通过访问http://gitlab.example.com/
进行代码管理,操作与github基本一致