mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-27 20:29:22 +02:00
Extract terminal in its own scene, add a few proper levels with a description
This commit is contained in:
parent
ebbb505283
commit
7373984d47
18 changed files with 179 additions and 92 deletions
levels/02-tree
21
levels/02-tree/description
Normal file
21
levels/02-tree/description
Normal file
|
@ -0,0 +1,21 @@
|
|||
Blobs just have some content and an ID. It would be convenient to be able to give names to a blob, right?
|
||||
|
||||
The second type of Git object is called a "tree" - a tree points a bunch of blobs, and gives each of them a name!
|
||||
|
||||
How can we build our own trees? Introducing: the index!
|
||||
|
||||
The index is like a "work in progress" version of a tree, where we can add and remove blobs. When we're happy with what we have built, we can make it into a real tree object!
|
||||
|
||||
We can use
|
||||
|
||||
$ git update-index --add <file>
|
||||
|
||||
to make the file's content into a blob, and to add that blob to the index using the file's name.
|
||||
|
||||
When we're happy with out index, we can convert it into a tree using
|
||||
|
||||
$ git write-tree
|
||||
|
||||
That command will output the ID of the newly crated tree.
|
||||
|
||||
Build a tree containing just the 'noises' file, which we conveniently placed in your current directory! :)
|
Loading…
Add table
Add a link
Reference in a new issue