3 ms·
A commit in the repo is simpler than that. It is: - A reference to the hash of a tree object - Some meta-data (one or more parent commits, author, date, messa
by edejong 10y ago
A commit in the repo is simpler than that. It is:
- A reference to the hash of a tree object
- Some meta-data (one or more parent commits, author, date, message).
The commit command (git commit) basically takes the tree object which you created in the index, your HEAD pointer (the commit you were at right now) and some user entered information to create a commit object.
So, notably, the commit does not store the changes! It stores a reference to the root of the index tree object (which contains references to the root of other tree objects or blobs). There are no diffs recorded anywhere, only calculated when needed.
- randomsearch 10y agoGiven how the above posters all seem to have a different opinion about the internals of git, the point of the article seems to be somewhat negated.
- randomsearch 10y agoGiven how the above posters all seem to have a different opinion about the internals of git, the point of the article seems to be somewhat negated.