mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-05 05:02:02 +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/ref-create
9
levels/ref-create/description
Normal file
9
levels/ref-create/description
Normal file
|
@ -0,0 +1,9 @@
|
|||
Let's take a look at "refs", short for "references"! Refs are not objects, but rather very simple *pointers* to objects! They can help you keep track of what's where.
|
||||
|
||||
You can create or update a ref with
|
||||
|
||||
git update-ref refs/<refname> <newvalue>
|
||||
|
||||
Make sure to start a ref's name with "refs/"! That's a convention that helps Git find all refs you create.
|
||||
|
||||
Create refs that point to all objects in this repository!
|
4
levels/ref-create/goal
Normal file
4
levels/ref-create/goal
Normal file
|
@ -0,0 +1,4 @@
|
|||
git update-ref refs/a $BLOB1
|
||||
git update-ref refs/b $BLOB2
|
||||
git update-ref refs/c $TREE
|
||||
git update-ref refs/d $COMMIT
|
7
levels/ref-create/start
Normal file
7
levels/ref-create/start
Normal file
|
@ -0,0 +1,7 @@
|
|||
echo hello > hello
|
||||
echo world > world
|
||||
BLOB1=$(git hash-object -w hello)
|
||||
BLOB2=$(git hash-object -w world)
|
||||
git add .
|
||||
TREE=$(git write-tree)
|
||||
COMMIT=$(git commit-tree $TREE -m "Initial commit")
|
3
levels/ref-create/win
Normal file
3
levels/ref-create/win
Normal file
|
@ -0,0 +1,3 @@
|
|||
OBJECTS=$(git cat-file --batch-check='%(objectname)' --batch-all-objects | sort)
|
||||
REF_TARGETS=$(git show-ref -s | sort | uniq)
|
||||
test "$OBJECTS" = "$REF_TARGETS"
|
Loading…
Add table
Add a link
Reference in a new issue