mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-07 05:02:04 +02:00
finished the mechanism for setting the language
This commit is contained in:
parent
705cc849c2
commit
50ee071f0e
214 changed files with 94 additions and 10 deletions
levels/en_EN/branches
49
levels/en_EN/branches/grow
Normal file
49
levels/en_EN/branches/grow
Normal file
|
@ -0,0 +1,49 @@
|
|||
title = Branches grow with you!
|
||||
cards = checkout commit-auto branch branch-delete reset-hard
|
||||
|
||||
[description]
|
||||
|
||||
Note that there are two options to "travel to the end of a timeline":
|
||||
|
||||
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
|
||||
git add .
|
||||
git commit -m "Evening preparations"
|
||||
echo "You go to the birthday party!" >> you
|
||||
git add .
|
||||
git commit -m "Go to the birthday"
|
||||
git branch birthday
|
||||
|
||||
git checkout HEAD~1
|
||||
echo "You go to the concert!" > you
|
||||
git add .
|
||||
git commit -m "Go to the concert"
|
||||
git branch concert
|
||||
|
||||
git checkout HEAD~1
|
||||
|
||||
git branch -D main
|
||||
|
||||
[win]
|
||||
|
||||
# Travel directly to the last yellow commit of the birthday timeline, make a change to 'you', and make a commit
|
||||
for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do
|
||||
if test $(git rev-parse $commit^) = $(git rev-parse birthday); then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
|
||||
# Travel to the blue 'concert' branch, make a change to 'you', and a commit.
|
||||
git show concert^ | grep "Go to the concert"
|
Loading…
Add table
Add a link
Reference in a new issue