mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-06-01 19:19:31 +02:00
finished the mechanism for setting the language
This commit is contained in:
parent
705cc849c2
commit
50ee071f0e
214 changed files with 94 additions and 10 deletions
levels/en_EN/changing-the-past
78
levels/en_EN/changing-the-past/reorder
Normal file
78
levels/en_EN/changing-the-past/reorder
Normal file
|
@ -0,0 +1,78 @@
|
|||
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]
|
||||
|
||||
# Reorder the commits to dress yourself in the correct way
|
||||
{ git log main --oneline | perl -0777 -ne'exit(1) if not /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