Git is a content-addressable filesystem.

1. Plumbing 和 Porcelain

  • "Plumbing commands": Git 底层的操作;
  • "Porcelain commands": Git 封装的操作,例如 checkout,branch,remote等;

2. Git 文件结构

  • git init: 在当前文件夹,创建.git目录;
  • "config": 当前项目的配置选项;
  • "info": 配置着在.gitignore中排除的文件内容;
  • "hooks": 包含客户端和服务端的hook;
  • 最重要的四个实体:
    • "objects": 存储着Git仓库的所有内容;
    • "refs": 指向已提交内容的指针(branches,tags,remotes and more);
    • "HEAD": 当前指向的分支;
    • "index"(待创建): 存储staging区域中的内容;

Git 进阶之底层相关

2.1 Objects

  • Tree Objects: 树类似于UNIX系统中的目录,Blob类似于文件;
  • Blob 文件的类型:
    • "100644": 表示正常的文件;
    • "100755": 表示为可执行文件;
    • "120000": 符号链接(symbolic link);

Git 进阶之底层相关

参考资料:

相关文章:

  • 2021-05-15
  • 2021-07-04
  • 2021-09-25
  • 2021-10-23
猜你喜欢
  • 2021-07-18
  • 2021-09-24
  • 2021-11-28
  • 2021-07-28
  • 2021-09-23
  • 2021-07-10
  • 2022-12-23
相关资源
相似解决方案