git本地结构
History 中包含节点信息,如:
History 可称为本地仓库
checkout
- 切换分支
- 从History或者index中复制文件到working dir
git checkout HEAD~ foo.c
从History的HEAD~ 节点中拷贝foo.c到index和working dir
git checkout HEAD~ foo.c
从index拷贝foo.c到working dir
diff
git diff : index/stage 和 working dir的区别
git diff -cached : History 和 index/stage 的区别
git diff HEAD : History 和 working dir的区别