登录GitLab
http://ip:端口号
用户名root,首次登录会强制用户修改密码
创建Project
安装Git工具
[root@root ~]# yum install git
生成密钥文件
[root@root ~]# ssh-keygen
[root@root ~]# cat ./.ssh/id_rsa.pub
新建一个Project , 添加ssh key , 保存项目地址
简单配置
# 配置使用Git仓库的人员姓名
[root@root ~]# git config --global user.name "testname"
# 配置使用Git仓库的人员email,填写自己的公司邮箱
[root@root ~]# git config --global user.email "abc@example.com"
# 克隆项目
[root@root ~]# git clone http://自己的ip/root/iteration.git
上传文件
# 进入到项目目录
[root@root ~]# cd iteration/
# 创建需要上传到GitLab中的目标文件
[root@root ~]# echo "test" > /root/test.sh
# 将目标文件或者目录复制到项目目录下
[root@root ~]# cp /root/test.sh ./
# 将test.sh文件加入到索引中
[root@root ~]# git add test.sh
# 将test.sh提交到本地仓库
[root@root ~]# git commit -m "test.sh"
# 将文件同步到GitLab服务器上
[root@root ~]# git push -u origin master
随手记账单小程序 期待大家的反馈

本文详细介绍如何登录GitLab,包括创建项目、安装Git工具、生成SSH密钥、配置Git用户信息、克隆项目、上传文件等步骤,是初学者快速上手GitLab的实用教程。
3878

被折叠的 条评论
为什么被折叠?



