git本地结构

git本地结构

History 中包含节点信息,如:

节点信息

History 可称为本地仓库

checkout

  1. 切换分支
  2. 从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的区别

posted on 2015-08-05 10:44  onesteng  阅读(144)  评论(0编辑  收藏  举报