mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-23 21:01:22 +02:00
Add split description in italia and english and add directory it in levels
This commit is contained in:
parent
943126647b
commit
2c275424a3
104 changed files with 3510 additions and 38 deletions
levels/it/branches
65
levels/it/branches/fork
Normal file
65
levels/it/branches/fork
Normal file
|
@ -0,0 +1,65 @@
|
|||
title = Make parallel commits
|
||||
cards = checkout commit-auto
|
||||
|
||||
[description]
|
||||
|
||||
Did you know that creating parallel timelines is perfectly legal and safe? It's true!
|
||||
|
||||
Can you find out when things went wrong in this zoo? Then, go back to the last good commit and create a parallel universe where everyone is happy!
|
||||
|
||||
[cli]
|
||||
|
||||
The blue animal represents a concept known as the "HEAD pointer" in Git: It shows you which commit is the current one.
|
||||
|
||||
Here's a cool trick to go to the previous commit:
|
||||
|
||||
git checkout HEAD^
|
||||
|
||||
You can also go back two commits by typing, for example:
|
||||
|
||||
git checkout HEAD~2
|
||||
|
||||
[setup]
|
||||
|
||||
mkdir cage
|
||||
echo "Looks very hungry." > cage/lion
|
||||
|
||||
echo "A small child.
|
||||
It really loves cats!" > child
|
||||
git add .
|
||||
git commit -m "The beginning"
|
||||
|
||||
echo "It's holding a lollipop." >> child
|
||||
git commit -am "The child buys something"
|
||||
|
||||
mv child cage
|
||||
git add .
|
||||
git commit -m "The child climbs somewhere"
|
||||
|
||||
git rm cage/child
|
||||
echo "Looks happy. :)" > cage/lion
|
||||
git add .
|
||||
git commit -m "Oh no"
|
||||
|
||||
echo "It's sleeping." > cage/lion
|
||||
git add .
|
||||
git commit -m "Nap time!"
|
||||
|
||||
git checkout --detach
|
||||
git branch -d main
|
||||
|
||||
[win]
|
||||
|
||||
# Make sure that the child is happy.
|
||||
git ls-tree --name-only -r HEAD | grep child
|
||||
|
||||
# Make sure that the lion gets something to eat.
|
||||
git show HEAD:cage/lion | grep -v "very hungry"
|
||||
|
||||
[congrats]
|
||||
|
||||
Whew, good job! This seems like a *much* better outcome.
|
||||
|
||||
Feel free to add more parallel timelines, or make them longer.
|
||||
|
||||
If you're ready, our next mission is already waiting...
|
Loading…
Add table
Add a link
Reference in a new issue