mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-01 20:42:01 +02:00
Polish levels some more, add a "congrats" text
This commit is contained in:
parent
6292d849b9
commit
5066840ae9
30 changed files with 87 additions and 30 deletions
levels/index-add
7
levels/index-add/congrats
Normal file
7
levels/index-add/congrats
Normal file
|
@ -0,0 +1,7 @@
|
|||
There's another way to add an entry to the index directly:
|
||||
|
||||
git update-index --add --cacheinfo <mode>,<blobhash>,<name>
|
||||
|
||||
The first three numbers of the mode describe the type of the entry, "100" is a regular file.
|
||||
|
||||
The second three number describe the permissions. Only "644" (non-executable) and "755" (executable) are supported.
|
|
@ -1,10 +1,10 @@
|
|||
Blobs usually represent the content of a file. But on their own, they don't have any metadata, not even a name!
|
||||
|
||||
Git has a very powerful concept to store metadata related to blobs: the index! It's a list that relates blobs to filenames and permissions.
|
||||
Git has a very powerful concept to store metadata related to blobs: the index! It's a list that relates blobs to filenames and access permissions.
|
||||
|
||||
Even though it is possible to add an entry directly to the index, it's much more convenient to do it via an existing file:
|
||||
The most convenient option to add an entry to the index is via an existing file:
|
||||
|
||||
$ echo "my content" > file
|
||||
$ git update-index --add file
|
||||
echo "my content" > file
|
||||
git update-index --add file
|
||||
|
||||
Add three entries to the index! For a bonus challenge: can you add a file that is inside of a directory, like "directory/file"?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue