底层命令

  1. git对象
  2. git hash-object -w fileUrl : 生成一个key(hash值):val(压缩后的文件内容)键值对存到.git/objects
  3. tree对象
  4. git update-index --add --cacheinfo 100644 hash test.txt : 往暂存区添加一条记录(让git对象 对应 上文件名)存到.git/index
  5. git write-tree : 生成树对象存到.git/objects
  6. commit对象
  7. echo 'first commit' | git commit-tree treehash : 生成一个提交对象存到.git/objects
  8. 对以上对象的查询
  9. git cat-file -p hash : 拿对应对象的内容
  10. git cat-file -t hash : 拿对应对象的类型

查看暂存区

  1. git ls-files -s