mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-17 05:02:12 +02:00
Polishing the intro chapter
This commit is contained in:
parent
a86fcaadbb
commit
cab8a9837c
7 changed files with 97 additions and 90 deletions
levels/intro
29
levels/intro/commit
Normal file
29
levels/intro/commit
Normal file
|
@ -0,0 +1,29 @@
|
|||
title = Your first commit
|
||||
cards = commit-auto
|
||||
|
||||
[description]
|
||||
|
||||
You can use your time machine to make snapshots of objects around you!
|
||||
|
||||
Here, let's practice this!
|
||||
|
||||
(Your teacher pours some water into a glass.)
|
||||
|
||||
[setup]
|
||||
|
||||
echo "The glass is full of water." > glass
|
||||
|
||||
[win]
|
||||
|
||||
# Make a snapshot of the glass (a "commit")
|
||||
git rev-parse HEAD
|
||||
|
||||
# Change the contents of the glass!
|
||||
! test "$(cat glass)" = "The glass is full of water."
|
||||
|
||||
# And make a second commit!
|
||||
git rev-parse HEAD^ && ! test "$(git show main:glass)" = "The glass is full of water."
|
||||
|
||||
[congrats]
|
||||
|
||||
Nice! You can try making some additional commits. When you feel comfortable, click on "Next Level".
|
Loading…
Add table
Add a link
Reference in a new issue