October 2016
Beginner
861 pages
20h 37m
English
Now, we have manually created objects in the Git database, but as nothing point to these objects, we have to remember them by their SHA-1 identifier. Furthermore, only the content of the files is stored in the database, so we learn to create a tree object that will refer to the blobs created.
We'll use the same repository of the last examples with the objects we created in the database.
We'll start by adding the first version of mytest.txt as follows:
$ git update-index --add --cacheinfo 100644 \ 926e8ffd3258ed6edd1e254438f02fd24e417acc mytest.txt
Now we can write the content of the staging area to the database:
$ git write-tree 4c4493f8029d491d280695e263e24772ab6962ce
We can update ...