mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-01 20:42:01 +02:00
Convert "internal" levels to new level format
This commit is contained in:
parent
613b1b9852
commit
53a6885ef9
108 changed files with 727 additions and 382 deletions
levels/internals
46
levels/internals/symref-no-deref
Normal file
46
levels/internals/symref-no-deref
Normal file
|
@ -0,0 +1,46 @@
|
|||
[description]
|
||||
|
||||
When you have a symbolic ref (a ref pointing at another ref), and you decide you want it to be a regular ref again (pointing to an object), you're in for some trouble! :)
|
||||
|
||||
What happens when you try pointing the symbolic ref directly to the blob using `git update-ref`?
|
||||
|
||||
Oops! Turns out that when you reference a symbolic ref, it acts as if you had specified the ref it points to. To de-symbolic-ize it, use the `--no-deref` option directly after `update-ref`!
|
||||
|
||||
Weird, huh?
|
||||
|
||||
[congrats]
|
||||
|
||||
Whew, we've covered a lot of things: Blobs! The index! Trees! Commits! Refs!
|
||||
|
||||
You now know about almost everything about how Git repositories look like on the inside! We think that's pretty cool! :)
|
||||
|
||||
Everything else is just convention and high-level commands that make interacting with the objects more convenient.
|
||||
|
||||
We haven't covered:
|
||||
|
||||
- tag objects (they are the fourth object type - a bit like refs with a description and an author)
|
||||
- configuration (allows you to specify remote repositories, for example)
|
||||
- working with local files (which is, uh, arguably pretty important :P)
|
||||
|
||||
Thanks for playing! You're welcome to check out the "puzzle" levels in the dropdown, some of them are more advanced!
|
||||
|
||||
[setup]
|
||||
|
||||
BLOB1=$(echo delicious | git hash-object -w --stdin)
|
||||
BLOB2=$(echo very | git hash-object -w --stdin)
|
||||
git update-ref refs/curly "$BLOB1"
|
||||
git symbolic-ref refs/fries refs/curly
|
||||
|
||||
[setup goal]
|
||||
|
||||
BLOB1=$(echo delicious | git hash-object -w --stdin)
|
||||
BLOB2=$(echo very | git hash-object -w --stdin)
|
||||
git update-ref refs/curly "$BLOB1"
|
||||
git symbolic-ref refs/fries refs/curly
|
||||
|
||||
git update-ref --no-deref refs/fries "$BLOB2"
|
||||
|
||||
[win]
|
||||
|
||||
git symbolic-ref refs/fries && return 1
|
||||
test "$(git show-ref -s refs/fries)" = "035e2968dafeea08e46e8fe6743cb8123e8b9aa6"
|
|
@ -1,13 +0,0 @@
|
|||
Whew, we've covered a lot of things: Blobs! The index! Trees! Commits! Refs!
|
||||
|
||||
You now know about almost everything about how Git repositories look like on the inside! We think that's pretty cool! :)
|
||||
|
||||
Everything else is just convention and high-level commands that make interacting with the objects more convenient.
|
||||
|
||||
We haven't covered:
|
||||
|
||||
- tag objects (they are the fourth object type - a bit like refs with a description and an author)
|
||||
- configuration (allows you to specify remote repositories, for example)
|
||||
- working with local files (which is, uh, arguably pretty important :P)
|
||||
|
||||
Thanks for playing! You're welcome to check out the "puzzle" levels in the dropdown, some of them are more advanced!
|
|
@ -1,7 +0,0 @@
|
|||
When you have a symbolic ref (a ref pointing at another ref), and you decide you want it to be a regular ref again (pointing to an object), you're in for some trouble! :)
|
||||
|
||||
What happens when you try pointing the symbolic ref directly to the blob using `git update-ref`?
|
||||
|
||||
Oops! Turns out that when you reference a symbolic ref, it acts as if you had specified the ref it points to. To de-symbolic-ize it, use the `--no-deref` option directly after `update-ref`!
|
||||
|
||||
Weird, huh?
|
|
@ -1 +0,0 @@
|
|||
git update-ref --no-deref refs/fries "$BLOB2"
|
|
@ -1,4 +0,0 @@
|
|||
BLOB1=$(echo delicious | git hash-object -w --stdin)
|
||||
BLOB2=$(echo very | git hash-object -w --stdin)
|
||||
git update-ref refs/curly "$BLOB1"
|
||||
git symbolic-ref refs/fries refs/curly
|
|
@ -1,2 +0,0 @@
|
|||
git symbolic-ref refs/fries && return 1
|
||||
test "$(git show-ref -s refs/fries)" = "035e2968dafeea08e46e8fe6743cb8123e8b9aa6"
|
Loading…
Add table
Add a link
Reference in a new issue