Comments by "Lawrence D’Oliveiro" (@lawrencedoliveiro9104) on "Git Overview - Computerphile" video.
-
The three basic objects in Git are blobs, trees and commits. A blob represents the contents of a file, and is identified by the SHA-256 hash of its contents. A tree associates names with blobs, and represents a snapshot of source tree contents at a point in time. A commit holds a pointer to a tree, and to zero or more parent commits, as well as information about who did the commit and when, an explanatory comment etc.
Trees and commits are also represented by SHA-256 hashes of their contents. This is why a commit holds pointers to its parents, not to its children; because once the commit has been created, it cannot be changed (e.g. to add child pointers) without losing its original SHA-256 ID.
Branches and tags are just pointers to particular commits. They have no associated SHA-256 hashes, so they can be added, removed and changed at any time.
23
-
19
-
11
-
11
-
8
-
8
-
7
-
7
-
7
-
6
-
3
-
3
-
2
-
2
-
2
-
2
-
2
-
2
-
1
-
1
-
1
-
1
-
1