docs: git objects

main
hau 2020-12-23 15:58:48 +07:00
parent a5f75d2c09
commit 450a172c6e
1 changed files with 21 additions and 0 deletions

21
2020-12-23-git-objects.md Normal file
View File

@ -0,0 +1,21 @@
# Git Objects
Git Objects are Blob Object, Tree Object, Commit Object.
All objects are stores at `.git/objects` with unique key (hash generated).
**Blob Object** is file content.
**Tree Object** is filename or directory.
![Simple version of the Git data model](https://git-scm.com/book/en/v2/images/data-model-1.png)
**Commit Object** contains top-level tree (snapshot at the time), parent commits, author and commit message.
Branch is pointer, which point to commit we want.
## References
- [Git Internals - Git Objects](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects)
- [Commits are snapshots, not diffs](https://github.blog/2020-12-17-commits-are-snapshots-not-diffs/)