mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-29 20:29:00 +02:00
Rename levels to avoid numbers
This commit is contained in:
parent
d5ac67c4cc
commit
15ec7a0df4
24 changed files with 0 additions and 0 deletions
levels/tree-create
21
levels/tree-create/description
Normal file
21
levels/tree-create/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