Table of Contents
1. 为什么要写这个文档.................................................................................................................1
2. GIT 和 SVN、CVS 的区别........................................................................................................1
3. 为什么要使用 git....................................................................................................................... 1
4. Git 的安装................................................................................................................................. 1
安装 git 客户端.......................................................................................................................1
安装 eclipse 的 git 插件..........................................................................................................2
配置 SSH 密钥....................................................................................................................... 2
5. 架构和原理............................................................................................................................... 2
git 的架构图........................................................................................................................... 2
workspace:本地工作目录....................................................................................................3
index 暂存区(索引区)........................................................................................................3
local repository 本地版本库...................................................................................................4
remote repository 中央(远程)版本库.................................................................................4
6. 常用 git 使用流程......................................................................................................................4
git clone 从中央版本库下载代码............................................................................................4
git pull 从中央版本库更新......................................................................................................4
.gitignore 设置忽略文件.........................................................................................................5
git status 提交前查看本地修改状态........................................................................................5
git commit 提交代码到本地版本库.........................................................................................5
git push 提交代码到中央版本库.............................................................................................6
7. 其他常用命令...........................................................................................................................6
git checkout HEAD 覆盖本地修改..........................................................................................6
git diff 比较差异..................................................................................................................... 6
git revert 撤销修改.................................................................................................................7
git config 设置 git 的用户名和邮箱..........................................................................................7