git

详细文章Git笔记(狂神说) - 墨染念颖 - 博客园 (cnblogs.com)

1、工作原理|流程

img

Workspace:工作区
Index / Stage:暂存区
Repository:本地仓库
Remote:远程仓库

2、常用命令

1
2
3
4
5
6
7
8
9
10
11
$ git config --system --list #查看系统config
$ git config --global --list #查看当前用户(global)配置
$ git config --global user.name "name" #名称
$ git config --global user.email 123456@qq.com #邮箱
$ git init #初始化
$ git add . #将所有文件添加到暂存区
$ git commit -m "消息内容" #将暂存区中的文件提交到本地仓库
$ git push #将本地仓库中的文件提交到远程仓库
$ git pull #用于从远程获取代码并合并本地的版本
$ git branch # 列出所有本地分支
$ git branch -r # 列出所有远程分支