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/time-machine
|
@ -1,77 +0,0 @@
|
|||
title = Reordering events
|
||||
cards = checkout commit-auto reset-hard rebase-interactive cherry-pick
|
||||
|
||||
[description]
|
||||
|
||||
Oops, looks like there's something messed up here. Can you put the events back into their correct order?
|
||||
|
||||
There are two ways to do this: You can drag the "interactive rebase" card to the commit before the one you want to change, then reorder the lines in the file that opens, and save it.
|
||||
|
||||
Or you can reset the main tag to the very first commit, and then cherry-pick single commits in the order you want. You have cards for both approaches!
|
||||
|
||||
[setup]
|
||||
|
||||
echo "You just woke up.
|
||||
|
||||
You are NOT wearing underwear.
|
||||
|
||||
You are NOT wearing pants.
|
||||
|
||||
You are NOT wearing a shirt.
|
||||
|
||||
You are NOT wearing shoes." > you
|
||||
git add .
|
||||
|
||||
git commit -m "The Beginning"
|
||||
|
||||
echo "You just woke up.
|
||||
|
||||
You are NOT wearing underwear.
|
||||
|
||||
You are NOT wearing pants.
|
||||
|
||||
You are NOT wearing a shirt.
|
||||
|
||||
You are wearing shoes." > you
|
||||
git commit -am "Put on shoes"
|
||||
|
||||
echo "You just woke up.
|
||||
|
||||
You are NOT wearing underwear.
|
||||
|
||||
You are wearing pants.
|
||||
|
||||
You are NOT wearing a shirt.
|
||||
|
||||
You are wearing shoes." > you
|
||||
git commit -am "Put on pants"
|
||||
|
||||
echo "You just woke up.
|
||||
|
||||
You are wearing underwear.
|
||||
|
||||
You are wearing pants.
|
||||
|
||||
You are NOT wearing a shirt.
|
||||
|
||||
You are wearing shoes." > you
|
||||
git commit -am "Put on underwear"
|
||||
|
||||
echo "You just woke up.
|
||||
|
||||
You are wearing underwear.
|
||||
|
||||
You are wearing pants.
|
||||
|
||||
You are wearing a shirt.
|
||||
|
||||
You are wearing shoes." > you
|
||||
git commit -am "Put on shirt"
|
||||
|
||||
[win]
|
||||
|
||||
{ git log main --oneline | grep -Pz "shoes[\s\S]*pants[\s\S]*underwear"; } && { test "$(git log main --oneline | wc -l)" -eq 5; }
|
||||
|
||||
[congrats]
|
||||
|
||||
Feel free to reset the level and try the other strategy! Which one do you like better?
|
Loading…
Add table
Add a link
Reference in a new issue