mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-01 20:42:01 +02:00
Allow multiple level sets, pull out default order into "sequence" file
This commit is contained in:
parent
a9f096636a
commit
5031009dd5
96 changed files with 37 additions and 29 deletions
levels/bottom-up/blob-create
5
levels/bottom-up/blob-create/congrats
Normal file
5
levels/bottom-up/blob-create/congrats
Normal file
|
@ -0,0 +1,5 @@
|
|||
Tip: You can also use a command like this to create a blob in a single line:
|
||||
|
||||
echo "awesome content" | git hash-object -w --stdin
|
||||
|
||||
Did you already notice that you can drag and drop all objects? :)
|
11
levels/bottom-up/blob-create/description
Normal file
11
levels/bottom-up/blob-create/description
Normal file
|
@ -0,0 +1,11 @@
|
|||
At its core, Git is very simple. It stores "objects", which are basically files identified by an "identifier" (short: ID).
|
||||
|
||||
There are four types of objects: blobs, trees, commits, and tags. The simplest type is a "blob", which is just a piece of text.
|
||||
|
||||
Let's create some blobs! To do that, create a file with the desired content, and then use
|
||||
|
||||
git hash-object -w <file>
|
||||
|
||||
The flag -w means "write", and tells Git to actually write the new blob to the disk.
|
||||
|
||||
Create three new blobs!
|
6
levels/bottom-up/blob-create/goal
Normal file
6
levels/bottom-up/blob-create/goal
Normal file
|
@ -0,0 +1,6 @@
|
|||
echo "Hi" > file1
|
||||
echo "Ho" > file2
|
||||
echo "Hu" > file3
|
||||
git hash-object -w file1
|
||||
git hash-object -w file2
|
||||
git hash-object -w file3
|
0
levels/bottom-up/blob-create/start
Normal file
0
levels/bottom-up/blob-create/start
Normal file
3
levels/bottom-up/blob-create/win
Normal file
3
levels/bottom-up/blob-create/win
Normal file
|
@ -0,0 +1,3 @@
|
|||
BLOB_COUNT=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep blob | wc -l)
|
||||
|
||||
test "$BLOB_COUNT" -gt 2
|
Loading…
Add table
Add a link
Reference in a new issue