Git Object: Tree
来源:互联网 发布:入门pcb设计软件 编辑:程序博客网 时间:2024/04/30 01:10
A git tree object is very similar to a filesystem directory.
Filesystem directories refer to other directories and files, while git trees refer to other git trees and git blobs:
Example: Filesystem Directories and Files; Git Trees and Files
Diagram 1: The filesystem
In Diagram 1, below, an example filesystem directory and files is shown.
- There are 3 directories: src, docs and the top of the working directory.
- There are 4 files named README, hello.c, hello.py and hello. The contents of the files are shown in the grey boxes below the filenames.
The commands for creating the files and directories, and adding the files to the git object store, is shown here.
Diagram 2: The Git Object Store
Diagram 2 shows how the files and directories are stored as git trees and blobs in the git object store, after the user adds and commits the files and directories to the git repository.
Diagram 2 shows the top of the git tree’s hash is 39179a1 (lower left-hand corner of the highest green triangle). That git tree refers to 3 objects:
- The blob that contains the contents of the README file.
- The tree that contains the contents of the src directory.
- The tree that contains the contents of the doc directory.
The first few bytes of the hash of each object is shown below the object.
Diagram 3: The Object Hashes
Diagram 3 adds annotation that shows how each object’s hash is referred to in the git trees.
Diagram 4: Objects Without Name Labels
Diagram 4 shows the same git object store, but without each of the objects including their name above the left side of the object. This more accurately that objects are stored by their hash. Git knows the name of an object when the object is referred to in a git tree: The git tree includes the object’s hash and its name.
In the next section, the commands for both creating the above git object store and displaying the hashes are shown.
Next: Git Session: The Commands Used For The Examples On This Page
Previous: The Git Blob Object
Related:
- Git Object: Tree
- All Git Object Types: Blob, Tree, Commit And Tag
- TREE OBJECT
- Object [object Object] has no method 'tree'
- Git Object: Commit
- Git Object: Tag
- Git背后的object
- source tree git 命令
- Git系列 --- git-dir & work-tree
- git学习--object database
- Git对象类型(Object types)
- git cherry-check error "fatal: bad object"
- GIT error: object file is empty?
- git“fatal: loose object”错误解决办法汇总
- GIT error: object file is empty?
- git error:object file * is empty
- git“fatal: loose object”错误解决办法汇总
- ARM Linux Developer - rmk's GIT tree
- 你很棒的---自我管理方法,一生受用!!!
- Friend友元inline内联
- 终端乱码的终极解决方案
- ORACLE不执行汉字问题
- 我的java思想007:定义常量和写死程序的量
- Git Object: Tree
- MySQL中的内置系统函数
- 代理模式--动态代理
- /proc/self/status
- Linux C函数库参考
- int main(int argc,char* argv[])详解
- 在struts2中使用拦截器(Interceptor)控制登录和权限
- Pioneer公司:展示新一代AR导航技术
- 黑马程序员:感悟“银行业务调度系统”