GitLab使用记录

GitLab

文章目录

  • [1. 常用命令](#1. 常用命令)
    • [1.1 配置邮箱 用户名](#1.1 配置邮箱 用户名)
    • [1.2 查看配置](#1.2 查看配置)
    • [1.3 基本语法](#1.3 基本语法)
  • [2. 连接gitlab](#2. 连接gitlab)
  • [3. 直接拉去项目](#3. 直接拉去项目)

1. 常用命令

1.1 配置邮箱 用户名

复制代码
git config --global user.name ShangzheChen
git config --global user.email 735511377@qq.com

1.2 查看配置

复制代码
cat ~/.gitconfig

这里设置的用户与之后的账号没有任何关系

1.3 基本语法

初始化

复制代码
git init

查看状态

复制代码
git status

添加到暂存区

复制代码
git add 文件名

变绿

删除

复制代码
git rm --cached  文件名

提交

复制代码
git commit -m 'first commit' 文件名

查看日志

复制代码
git reflog
git log

切回之前的版本

复制代码
git reset --hard 版本号

2. 连接gitlab

创建本地库

提交到暂存目录

变绿后 继续上个操作

关掉分析代码

直接commit

将idea内的ignore文件拿出

过滤掉一些文件

复制代码
# class
*.class

# target
/target/

#log
*.log

上传

直接push

3. 直接拉去项目

会切到main上

删除ignore文件后可以切到dev

相关推荐
Gazer_S4 天前
【GitLab npm Registry 非标准端口安装问题解决方案】
前端·npm·gitlab
-KamMinG4 天前
Gitlab版本升级方案-13.x到17.x
gitlab
菜鸡00016 天前
把一个项目传到 GitLab 的某个群组
大数据·elasticsearch·gitlab
AlbertS7 天前
记一次推送lfs失败不能迁移git仓库到新的gitlab的问题
git·ai·gitlab·lfs·rejected
日更嵌入式的打工仔7 天前
Windows 下 GitLab 完整使用指南
windows·gitlab
会飞的大可7 天前
Jenkins vs GitLab CI/CD:2026 企业级 CI/CD 工具深度选型评测
ci/cd·gitlab·jenkins
庭風7 天前
让 AI 从需求直接走到 MR:我开源了一个面向 GitLab 的工作流 MCP
gitlab
Sakuyu434688 天前
Git-GitLab-JenKins
git·gitlab·jenkins
Aaron_dw8 天前
基于 Jenkins + GitLab + 自动化测试的 CI/CD 自动化系统方案(IaC + 弹性构建节点)
ci/cd·gitlab·jenkins
虎头金猫8 天前
自建 GitLab 没公网?用内网穿透技术,远程开发协作超丝滑
运维·服务器·网络·开源·gitlab·开源软件·开源协议