mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-04-29 16:53:55 +02:00
Polish branches chapter
This commit is contained in:
parent
80c50bdc81
commit
be45b82e41
18 changed files with 231 additions and 191 deletions
levels/branches
|
@ -1,4 +1,4 @@
|
|||
title = Choose your own adventure
|
||||
title = Deleting branches
|
||||
cards = checkout commit-auto reset-hard branch-delete
|
||||
|
||||
[description]
|
||||
|
@ -7,8 +7,6 @@ Life is full of dangers, right? Even when walking to school, it seems like there
|
|||
|
||||
This Monday is especially bad. You made it to school, but there's some timelines you definitely don't want to keep around.
|
||||
|
||||
Find the bad branches and delete them. Keep the one that seems okay.
|
||||
|
||||
[setup]
|
||||
|
||||
echo You leave your house and start walking to school. > you
|
||||
|
@ -33,14 +31,16 @@ echo Because you\'re kind of late, you start running. Someone throws a piano out
|
|||
git commit -am "Sounds nice"
|
||||
|
||||
git checkout HEAD^ -b ice-cream
|
||||
echo You\'re not in a hurry, and walk slowly. You even get some ice cream on your way. You arrive at school too late, and your teacher is angry. >> you
|
||||
echo You\'re not in a hurry, and walk slowly. You even get some ice cream on your way. You arrive at school too late, your teacher is angry, and you are expelled. >> you
|
||||
git commit -am "Yum"
|
||||
|
||||
git checkout main
|
||||
git branch -M main leap
|
||||
git checkout leap^^
|
||||
|
||||
[win]
|
||||
|
||||
test "$(git branch | cut -c 3-)" = "$(echo -e ice-cream\\nmain)"
|
||||
# Find the bad branches and delete them. Keep the best one.
|
||||
test "$(git show-ref --heads | cut -f2 -d' ')" = "$(echo refs/heads/leap)"
|
||||
|
||||
[congrats]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue