mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-05 05:02:02 +02:00
Add cli hints to the first three levels
This commit is contained in:
parent
437cbb7a37
commit
7ecc55a3fb
10 changed files with 75 additions and 15 deletions
levels/branches
|
@ -7,6 +7,10 @@ You were invited to two parties! At one of them, your favorite band is playing -
|
|||
|
||||
To make it easier to tell which timeline is which, you can create time portals! (We call these "branches".)
|
||||
|
||||
[cli]
|
||||
|
||||
Branches also make it really easy to travel between different places using the command line! As soon as you have a branch called "birthday", you can type `git checkout birthday` to travel to it!
|
||||
|
||||
[setup]
|
||||
|
||||
echo "You wrap the birthday present, and grab your concert ticket." > you
|
||||
|
|
|
@ -9,6 +9,12 @@ The grey panel below shows your current environment - click on an object to insp
|
|||
|
||||
Can you find out what happened here? Then, while on the latest commit, edit the files to fix the problem, and make a new commit!
|
||||
|
||||
[cli]
|
||||
|
||||
To checkout a specific commit, type `git checkout`, then a space, and then right click on the commit you want!
|
||||
|
||||
This will insert the commit's unique identifier!
|
||||
|
||||
[setup]
|
||||
|
||||
echo "This piggy bank belongs to the big sister.
|
||||
|
|
|
@ -7,6 +7,18 @@ Did you know that creating parallel timelines is perfectly legal and safe? It's
|
|||
|
||||
Can you find out when things went wrong in this zoo, 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
|
||||
|
|
|
@ -9,6 +9,12 @@ First, you can directly travel to the commit, like we've done it before.
|
|||
|
||||
And second, you can travel to the branch label. In this case, when you make a new commit, the branch will grow with you, and still point at the end of the timeline!
|
||||
|
||||
[cli]
|
||||
|
||||
To travel to a branch, type `git checkout name_of_the_branch`.
|
||||
|
||||
And to travel to the last commit, type `git checkout --detach name_of_the_branch`.
|
||||
|
||||
[setup]
|
||||
|
||||
echo "You wrap the birthday present, and grab your concert ticket." > you
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue