![]() which includes the hash ID of earlier commit F. Git can use this to yank commit G back out of its database, which gets a different saved snapshot, and the metadata for G. The metadata stores the raw hash ID of earlier commit G. That gets Git the saved snapshot, plus the metadata. Git can yank commit H back out of its big database-of-all-commits, 1 using the hash ID. ![]() Where H stands in for the actual hash ID of the last of these commits. So, if we have a chain of commits, all in a row, we can draw them like this. In this metadata, Git stores the hash ID of the previous commit, that comes just before the new commit you just made. These files are stored in a special, compressed, read-only, Git-only format, with the files being de-duplicated, so that if a new commit re-uses most of the files from an old commit, they don't actually take any space.Īnd, each commit stores some metadata: information such as your name and email address, and some date-and-time-stamps. Every commit saves two things:Įach commit stores a full snapshot of every file (that Git knows about at the time you, or whoever, make the commit). You could erase the hash ID of any previous commit (though you don't have to). Every time you make a new commit in "detached HEAD" state, you would have to write down the hash ID of the new commit you just made. ![]() So that's all you'd really need to write down. In fact, though, it only saves one hash ID. But what if you make a mistake or typo while copying down these hash IDs? It would be better to have the computer save them. If you write down the hash IDs of each of your commits, you can get them back, for a while at least. The hash IDs are those big ugly strings of letters and digits, such as e1cfff676549cdcd702cbac105468723ef2722f4. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |