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/intro
31
levels/intro/checkout
Normal file
31
levels/intro/checkout
Normal file
|
@ -0,0 +1,31 @@
|
|||
title = Getting the last version
|
||||
cards = checkout-file
|
||||
|
||||
[description]
|
||||
|
||||
You've been working on your essay for a while. But - ughh! Now your cat walks over your keyboard and "helps you", so now it's all messed up! :/
|
||||
|
||||
But Git is here to help! To discard all changes your cat made, and go back to the version in the last commit, use `checkout`!
|
||||
|
||||
[setup]
|
||||
|
||||
echo "A" >> essay.txt
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
|
||||
echo "B" >> essay.txt
|
||||
git commit -a -m "Improved version"
|
||||
|
||||
echo "C" >> essay.txt
|
||||
git commit -a -m "Even better version"
|
||||
|
||||
echo "D" >> essay.txt
|
||||
git commit -a -m "Marvelous version"
|
||||
|
||||
echo "blarg
|
||||
blaaaargh" > essay.txt
|
||||
|
||||
[win]
|
||||
|
||||
# Restore the version from the last commit.
|
||||
cat essay.txt | grep D
|
Loading…
Add table
Add a link
Reference in a new issue