1、gitlab 软件下载地址
官方源:https://packages.gitlab.com/gitlab/gitlab-ce/
清华源:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
注意:ce为社区版,ee为企业版
2、安装依赖包
yum install -y curl policycoreutils-python openssh-server
3、安装gitlab
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
yum clean all && yum makecache
yum install gitlab-ce -y
3.1 rpm 安装gitlab【openEuler系统】
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/ol/9/gitlab-ce-17.1.2-ce.0.el9.x86_64.rpm/download.rpm
#安装依赖包
ln -s /usr/lib64/libcrypt.so.1 /usr/lib64/libcrypt.so.2
yum install policycoreutils-python -y
rpm -ivh gitlab-ce-17.1.1-ce.0.el9.x86_64.rpm
#目录说明
/opt/gitlab #默认gitlab程序安装路径
/var/opt/gitlab/ #gitlab数据目录
/var/opt/gitlab/git-data/ #项目存储目录
/var/opt/gitlab/git-data/repositories #代码存放路径
#常用命令
gitlab-ctl status #查看目前gitlab所有服务
gitlab-ctl stop #停止gitlab服务
gitlab-ctl stop nginx #单独停止某一个服务
gitlab-ctl tail #查看所有服务日志
gitlab-ctl restart # 重启服务
gitlab-ctl reconfigure #重载配置
gitlab-ctl restart #启动服务
gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab
4、修改配置
cat /etc/gitlab/gitlab.rb
external_url 'http://192.168.x.x:8080' # 改成本机ip 地址
5、重载配置,需要等待
gitlab-ctl reconfigure
账户是root, 初始密码查看 cat /etc/gitlab/initial_root_password,可以在页面修改密码
gitlab 17.1.1 版本管理员密码修改:
gitlab-rails console -e production
user = User.where(id: 1).first #查询id 为1的用户,1为超级管理员
user.password = '新密码'
user.password_confirmation = '新密码'
user.save! #保存
quit #退出
gitlab-ctl restart #重启服务
6、检查服务,查看服务状态
ss -tnlp | grep 8080
gitlab-ctl status
#查看版本
gitlab-rake gitlab:env:info
#设置中文
1、点击 edit-profile->Preferences->Localization->Language->选择中文 save-changes【保存刷新】
#gitlab 权限
Private:只有组成员才能看到
Internal:只要登录的用户就能看到
Public:所有人都能看到
操作使用:
如图:
1、创建群组
2、输入群组描述,头像等
3、选择谁可以访问该组的项目
4、配置权限,私有、内部、公开
5、在该群组创建项目,写上项目名称和标识
#在服务器上创建密钥对,添加公钥到gitlab
点击编好设置-SSH密钥
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)