mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-01 20:42:01 +02:00
Rename chapters into "internals" and "intro"
This commit is contained in:
parent
70fe577788
commit
f3ff5c5147
97 changed files with 0 additions and 0 deletions
levels/internals/symref-no-deref
13
levels/internals/symref-no-deref/congrats
Normal file
13
levels/internals/symref-no-deref/congrats
Normal file
|
@ -0,0 +1,13 @@
|
|||
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!
|
7
levels/internals/symref-no-deref/description
Normal file
7
levels/internals/symref-no-deref/description
Normal file
|
@ -0,0 +1,7 @@
|
|||
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
levels/internals/symref-no-deref/goal
Normal file
1
levels/internals/symref-no-deref/goal
Normal file
|
@ -0,0 +1 @@
|
|||
git update-ref --no-deref refs/fries "$BLOB2"
|
4
levels/internals/symref-no-deref/start
Normal file
4
levels/internals/symref-no-deref/start
Normal file
|
@ -0,0 +1,4 @@
|
|||
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
|
2
levels/internals/symref-no-deref/win
Normal file
2
levels/internals/symref-no-deref/win
Normal file
|
@ -0,0 +1,2 @@
|
|||
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