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忽略文件

相关推荐
{⌐■_■}9 小时前
【git】提交修改、回撤、回滚、Tag 操作讲解,与reset (--soft、--mixed、--hard) 的区别
大数据·git·elasticsearch
GardenTu12 小时前
初尝git自结命令大全与需要理解的地方记录
git·github
真就死难20 小时前
Git是什么
git
机械心1 天前
代码管理git详细使用教程及最佳实践路径
git
hkj88081 天前
Git 常用命令
git
dawnkylin1 天前
通过 fork 为项目做出贡献
git·github
1379003402 天前
Git 设置代理
git
xiaodunmeng2 天前
sourcetree gitee 详细使用
git
LostSpeed2 天前
git,gitea - tool - creat Gitea Empty Rep Dir
git·gitea
前端郭德纲2 天前
vscode默认终端怎么设置成git bash
git·vscode·bash