GitLab使用的最简便方式

GitLab介绍

GitLab是一个基于Git版本控制系统的开源平台,用于代码托管,持续集成,以及协作开发。它提供了一套完整的工具,以帮助开发团队协同工作、管理和部署代码。
往往在企业内部使用gitlab管理代码,记录一下将本地代码推送到GitLab的步骤

1.登录GitLab账号,创建新的空白项目


2.在本地电脑上安装git,生成ssh密钥,并将公钥复制到gitLab的ssh密钥选项中

bash 复制代码
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

替换 "your_email@example.com" 为你的电子邮件地址。按照提示输入密码或者直接按下回车键以留空密码。这将生成一个 SSH 密钥对

3.全局设置用户连接信息

bash 复制代码
git config --global user.name "Your Name"
git config --global user.email "your_email@example.com"

替换 "Your Name" 和 "your_email@example.com" 为你的名字和电子邮件地址。

4. 使用http克隆 已创建的GitLab 仓库至本地

bash 复制代码
 git clone http://192.168.11.102:20528/wzl/mss-v1.0.git

http://192.168.11.102:20528,换成你个人url中的内容

5.将本地代码复制到从远程拉取的GitLab仓库中,提交代码

bash 复制代码
git add .
git commit -m "Your commit message"

6.推动代码至远程的GitLab仓库中

bash 复制代码
git push 
相关推荐
木雷坞1 天前
csdn-enterpriseGitLab Runner docker pull 慢:并行流水线镜像拉取排查
运维·docker·容器·gitlab
一只大袋鼠1 天前
Git (三):Tag 标签管理、图形工具、IDEA 集成与 GitLab 私有化部署
开发语言·git·gitlab
Lyra_Infra4 天前
故障排查报告:GitLab 18.11.3 后台 Settings 500
gitlab
Mike_6666 天前
git@gitlab-rdc.xxxxx.com: Permission denied (publickey).fatal: 无法读取远程仓库。
git·elasticsearch·gitlab
雨声不在8 天前
gitlab ci Runner 配置
gitlab·cicd
曾庆睿10 天前
【基于 RHEL 9.3 的 K8s + GitLab 全自动化部署环境搭建第一篇】
kubernetes·自动化·gitlab
曾庆睿10 天前
【基于 RHEL 9.3 的 K8s + GitLab 全自动化部署环境搭建第二篇】
kubernetes·自动化·gitlab
xmlhcxr14 天前
从 0 到 1 落地企业级 DevOps CI/CD 流水线:基于 GitLab+Jenkins+Harbor 的完整实践
运维·docker·gitlab·jenkins·harbor·devops
高旭的旭15 天前
GitLab Omnibus Docker 内存优化实战:从 4.7 GiB 降到 3.2 GiB
docker·容器·gitlab