一、安装准备
1、下载镜像地址:
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-14.9.1-ce.0.el7.x86_64.rpm
2、下载依赖
http://mirror.centos.org/centos/7/os/x86_64/Packages/policycoreutils-python-2.5-34.el7.x86_64.rpm
二、安装
rpm -ivh policycoreutils-python-2.5-34.el7.x86_64.rpm
rpm -ivh gitlab-ce-14.9.1-ce.0.el7.x86_64.rpm
三、编辑配置文件:vim /etc/gitlab/gitlab.rb
# 修改访问URL
external_url 'http://ip:port'
四、重置
gitlab-ctl reconfigure
五、浏览器登录
用户名是root。
密码在 /etc/gitlab/initial_root_password ,一定要在安装的24小时内查看登录,否则24小时之后,此文件会被删除。
我们就可以创建用户组,创建用户,创建仓库,上传仓库,赋权
六、附带Linux操作命令
# 常用命令
# 启动所有 gitlab 组件
gitlab-ctl start# 停止所有 gitlab 组件
gitlab-ctl stop# 重启所有 gitlab 组件
gitlab-ctl restart# 查看服务状态
gitlab-ctl status# 刷新配置文件
gitlab-ctl reconfigure# 修改默认的配置文件
vim /etc/gitlab/gitlab.rb# 检查gitlab
gitlab-rake gitlab:check SANITIZE=true --trace# 查看日志;
gitlab-ctl tail