mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-01 20:42:01 +02:00
Reorder levels and chapters into a better sequence
This commit is contained in:
parent
5c1f1ce722
commit
c99a35d54f
40 changed files with 128 additions and 288 deletions
levels/bisect
42
levels/bisect/bisect
Normal file
42
levels/bisect/bisect
Normal file
|
@ -0,0 +1,42 @@
|
|||
title = Yellow brick road
|
||||
cards = checkout commit-auto reset-hard bisect-start bisect-good bisect-bad
|
||||
|
||||
[description]
|
||||
|
||||
(Please zoom out a bit using your mouse wheel! :D)
|
||||
|
||||
Oh no! You have lost your key at some point during the day!
|
||||
|
||||
Sure, you could look at every single commit in an attempt to find it - but there's a better way: your time machine has a built-in way to find the point in time where things went wrong quickly!
|
||||
|
||||
First, play the "bisect start" card. Then, go to a commit where you don't have the key, and play the "bisect bad" card. Likewise, go to a commit early on where you have the key, and play the "bisect good card".
|
||||
|
||||
After you've found the last good commit, reset the main branch to it. What happened to the key after you lost it?
|
||||
|
||||
[setup]
|
||||
|
||||
echo "You still have your key." > you
|
||||
|
||||
for i in {1..60}; do
|
||||
if test $i -eq 18; then
|
||||
echo "Your pocket is empty." > you
|
||||
echo "Is on the ground." > key
|
||||
fi
|
||||
if test $i -eq 19; then
|
||||
echo "Is holding a key in its beak." > bird
|
||||
rm key
|
||||
fi
|
||||
if test $i -eq 20; then
|
||||
rm bird
|
||||
fi
|
||||
git add .
|
||||
git commit --allow-empty -m "$i"
|
||||
done
|
||||
|
||||
[win]
|
||||
|
||||
test "$(git log --pretty=%s main | head -1)" -eq 17
|
||||
|
||||
[congrats]
|
||||
|
||||
Well done! :) The only problem is that you now have to walk all the way back home, again...
|
Loading…
Add table
Add a link
Reference in a new issue