安装gitlab并上传本地项目

服务端使用 ubuntu 24.04

1、安装gitlab:

(1)、安装依赖包:

sudo apt update

sudo apt install -y curl openssh-server ca-certificates tzdata perl

(2)、安装 gitlab:

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

更换为自己服务器的ip

sudo EXTERNAL_URL="http://192.168.187.131" apt install gitlab-ce

安装完出现这个页面

查看服务状态是否正常:sudo gitlab-ctl status

3、登录 gitlab:

获得 root 用户初始密码:sudo cat /etc/gitlab/initial_root_password

登录: http://192.168.187.131 root / 初始密码,登录后修改密码

4、创建工作组、用户、项目

(1)、创建工作组
(2)、创建用户
(3)、组中添加用户

(4)、创建项目、选择组
(5)、项目中可添加用户

一般都是通过组来控制权限,不建议在项目中直接添加用户

5、生成token

选择有效期和权限,生成token,生成的token务必要保存下来

6、上传代码

(1)、复制git地址 :
(2)、idea中 右键 项目,在git中选择管理远程,添加地址

如果提示需要token,输入步骤五中的token

关联地址后 右键项目-->git --> 推送 即可

相关推荐
爱宇阳2 天前
从零开始部署 GitLab CE 18.4.2:Docker Compose 新手教程
docker·容器·gitlab
Narutolxy3 天前
从混合部署到高可用:在内网环境下搭建 GitLab-Jenkins-OpenResty的完整实战复盘20251014
gitlab·jenkins·openresty
字节逆旅3 天前
Git提交后追加修改操作指南
gitlab
爱宇阳3 天前
GitLab Docker Compose 迁移教程
docker·容器·gitlab
Blue啊3 天前
code Merge(qcc)
git·gitlab
友莘居士3 天前
极速迁移:GitLab项目无缝转移实战手册
gitlab·代码迁移·git命令
谢栋_3 天前
基于 GitLab CI/CD 与 Google Gemini 的 AI Code Review 自动化方案
人工智能·ci/cd·gitlab
lijunjun5 天前
当ubuntu 系统的IP地址修改之后,gitlab服务应该如何修改?
tcp/ip·ubuntu·gitlab
Qperable8 天前
gitlab-runner提示401 Unauthorized
后端·gitlab
西瓜er8 天前
Docker 一键部署指南:GitLab、Nacos、Redis、MySQL 与 MinIO 全解析
redis·docker·gitlab