mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-12-22 20:32:38 +01:00
branch create level
This commit is contained in:
parent
91e5f3749a
commit
3904abb6c4
1 changed files with 35 additions and 0 deletions
35
levels/time-machine/branch-create
Normal file
35
levels/time-machine/branch-create
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
title = Party Time
|
||||||
|
cards = checkout commit-auto reset-hard branch
|
||||||
|
|
||||||
|
[description]
|
||||||
|
|
||||||
|
You were invited to two parties but they will happen at the same time! At party 1 your favorite band is playing and the other one is your best friend's birthday party.
|
||||||
|
|
||||||
|
Where should you go? No worries - you are a time travel agent in training. You can go to both parties! To quickly switch between both events, check out the last commits and
|
||||||
|
create branches with the `git branch [string]` command. Now you can easily switch between both branches by calling `git checkout [branch]`.
|
||||||
|
|
||||||
|
[setup]
|
||||||
|
|
||||||
|
echo "-Birthday present.
|
||||||
|
-Concert ticket." > backpack
|
||||||
|
git add .
|
||||||
|
git commit -m "evening preparations"
|
||||||
|
echo "-Birthday present." > backpack
|
||||||
|
git add .
|
||||||
|
git commit -m "go to the birthday"
|
||||||
|
|
||||||
|
git checkout HEAD~1
|
||||||
|
echo "-Concert ticket." > backpack
|
||||||
|
git add .
|
||||||
|
git commit -m "go to the concert"
|
||||||
|
|
||||||
|
git checkout HEAD~1
|
||||||
|
|
||||||
|
[win]
|
||||||
|
|
||||||
|
NUM_BRANCHES="$(git branch -a | wc -l)"
|
||||||
|
test "$NUM_BRANCHES" -ge 4
|
||||||
|
|
||||||
|
[congrats]
|
||||||
|
|
||||||
|
Your friend is happy that you made it to the birthday party and you also got your concert ticket signed. Yay!
|
Loading…
Reference in a new issue