Git使用教程

Git安装

官网地址

bash 复制代码
https://git-scm.com/















Git学习资料

bash 复制代码
https://gitee.com/all-about-git

设置用户签名(首次安装必须)

设置用户名和邮箱

查看设置信息

bash 复制代码
# 设置用户名
git config --global user.name=zhangsan
# 设置邮箱
git config --global user.email=zhangsan@qq.com
# 查看配置信息
git config -l


查看系统配置

查看所有配置

bash 复制代码
git config -l

查看系统配置

bash 复制代码
git config --system --list


查看当前用户配置

bash 复制代码
git config --global --list


Git工作流程

Git管理的文件有3种状态:已修改(modified),已暂存(staged),已提交(committed)

本地仓库创建

创建全新仓库

bash 复制代码
git init

克隆远程仓库

bash 复制代码
git clone https://gitee.com/jfinal/jfinal.git

文件操作指令

查看文件状态

bash 复制代码
git status

添加所有文件到暂存区

bash 复制代码
git add .

提交暂存区中的内容到本地仓库

bash 复制代码
git commit -m "first commit"

gitignore忽略文件

相关推荐
李日灐17 小时前
< 7 > Linux 开发工具:git 版本控制器 和 cgdb/gdb 调试器
linux·运维·服务器·开发语言·git·调试器·gdb/cgdb
Gust of wind17 小时前
idea结合git和Gitee的初步使用
git·gitee·intellij-idea
夜七少eleanor17 小时前
【Git】2026全图文详解安装教程
git
海边的Kurisu17 小时前
从零开始的Git生活 | 刚实习同学的噩梦 And 参与开源不可缺的一环
git·生活
不老刘18 小时前
Git Cherry-Pick:微前端架构下的“精准医疗”与最佳实践
前端·git
爬楼的猪19 小时前
Git Folder Dashboard
git
Uncertainty!!19 小时前
claude code中添加skills自动生成git commit信息
git·git commit·claude code
FserSuN21 小时前
Git Worktree 使用学习
git·学习
Z文的博客21 小时前
嵌入式LINUX QT 开发 .gitignore 文件编写指南
linux·git·qt·elasticsearch·嵌入式
前端双越老师1 天前
3 个命令 7 个步骤,学会 git worktree 并行开发
git·ai编程·全栈