July 2018
Intermediate to advanced
354 pages
10h 57m
English
As we learned previously, the add command creates the blob, tree, and commit objects; however, they are also created when we run the commit command. We can view these objects using the cat-file command, as we saw in the previous recipe:
$ git cat-file -p HEAD tree 162201200b5223d48ea8267940c8090b23cbfb60 parent 13dcada077e446d3a05ea9cdbc8ecc261a94e42d author John Doe <john.doe@example.com> 1524163792 +0200 committer John Doe <john.doe@example.com> 1524163792 +0200
Making changes to another file.
The root-tree object from the commit is as follows:
$ git cat-file -p HEAD^{tree}
100644 blob f21dc2804e888fee6014d7e5b1ceee533b222c15 README.md
040000 tree abc267d04fb803760b75be7e665d3d69eeed32f8 a_sub_directory
100644 blob 35d31106c5d6fdb38c6b1a6fb43a90b183011a4b ...Read now
Unlock full access