mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-29 20:29:00 +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/it_IT/merge
47
levels/it_IT/merge/conflict
Normal file
47
levels/it_IT/merge/conflict
Normal file
|
@ -0,0 +1,47 @@
|
|||
title = Contradictions
|
||||
cards = checkout commit-auto merge reset-hard
|
||||
|
||||
[description]
|
||||
|
||||
Sometimes, timelines will contradict each other.
|
||||
|
||||
For example, in this case, one of our clients wants these timelines merged, but they ate different things for breakfast in both timelines.
|
||||
|
||||
Try to merge them together! You'll notice that there will be a conflict! The time machine will leave it up to you how to proceed: you can edit the problematic item, it will show you the conflicting sections. You can keep either of the two versions - or create a combination of them! Remove the >>>, <<<, and === markers, and make a new commit to finalize the merge!
|
||||
|
||||
Let your finalized timeline be the "main" one.
|
||||
|
||||
[setup]
|
||||
|
||||
echo "Just woke up. Is hungry." > sam
|
||||
git add .
|
||||
git commit -m "The beginning"
|
||||
|
||||
git checkout -b pancakes
|
||||
echo "Had blueberry pancakes with maple syrup for breakfast." > sam
|
||||
git add .
|
||||
git commit -m "Pancakes!"
|
||||
|
||||
echo "
|
||||
Is at work." >> sam
|
||||
git commit -am "Go to work"
|
||||
|
||||
git checkout -b muesli main
|
||||
echo "Had muesli with oats and strawberries for breakfast." > sam
|
||||
git add .
|
||||
git commit -m "Muesli!"
|
||||
|
||||
echo "
|
||||
Is at work." >> sam
|
||||
git commit -am "Go to work"
|
||||
|
||||
git checkout main
|
||||
|
||||
[win]
|
||||
|
||||
# Make a breakfast compromise in the 'main' branch.
|
||||
git rev-parse main^ && test "$(git rev-parse main^1^^)" = "$(git rev-parse main^2^^)"
|
||||
|
||||
[congrats]
|
||||
|
||||
Yum, that sounds like a good breakfast!
|
82
levels/it_IT/merge/merge
Normal file
82
levels/it_IT/merge/merge
Normal file
|
@ -0,0 +1,82 @@
|
|||
title = Merging timelines
|
||||
cards = checkout commit-auto merge
|
||||
|
||||
[description]
|
||||
|
||||
Here's a trick so that you can sleep a bit longer: just do all your morning activities in parallel universes, and then at the end, merge them together!
|
||||
|
||||
[setup]
|
||||
|
||||
echo "You do not have a baguette.
|
||||
|
||||
You do not have coffee.
|
||||
|
||||
You do not have a donut." > you
|
||||
|
||||
git add .
|
||||
git commit -m "The Beginning"
|
||||
|
||||
echo "You have a baguette.
|
||||
|
||||
You do not have coffee.
|
||||
|
||||
You do not have a donut." > you
|
||||
git add .
|
||||
git commit -m "You buy a baguette"
|
||||
|
||||
echo "You ate a baguette.
|
||||
|
||||
You do not have coffee.
|
||||
|
||||
You do not have a donut." > you
|
||||
git add .
|
||||
git commit -m "You eat the baguette"
|
||||
|
||||
git checkout HEAD~2
|
||||
echo "You do not have a baguette.
|
||||
|
||||
You have coffee.
|
||||
|
||||
You do not have a donut." > you
|
||||
git add .
|
||||
git commit -m "You buy some coffee"
|
||||
|
||||
echo "You do not have a baguette.
|
||||
|
||||
You drank coffee.
|
||||
|
||||
You do not have a donut." > you
|
||||
git add .
|
||||
git commit -m "You drink the coffee"
|
||||
|
||||
git checkout HEAD~2
|
||||
echo "You do not have a baguette.
|
||||
|
||||
You do not have coffee.
|
||||
|
||||
You have a donut." > you
|
||||
git add .
|
||||
git commit -m "You buy a donut"
|
||||
|
||||
echo "You do not have a baguette.
|
||||
|
||||
You do not have coffee.
|
||||
|
||||
You ate a donut." > you
|
||||
git add .
|
||||
git commit -m "You eat the donut"
|
||||
|
||||
git checkout --detach
|
||||
git branch -D main
|
||||
|
||||
[win]
|
||||
|
||||
# Build a situation where you consumed a baguette, a coffee, *and* a donut.
|
||||
{ git show HEAD:you | grep "You ate.*baguette"; } && { git show HEAD:you | grep "You drank.*coffee"; } && { git show HEAD:you | grep "You ate.*donut"; }
|
||||
|
||||
# Be on a merge commit.
|
||||
test "$(git log --pretty=%P -n 1 HEAD | wc -w)" -ge 2
|
||||
|
||||
[congrats]
|
||||
|
||||
I wonder if you're more relaxed when you *sleep* in parallel timelines...
|
54
levels/it_IT/merge/merge-abort
Normal file
54
levels/it_IT/merge/merge-abort
Normal file
|
@ -0,0 +1,54 @@
|
|||
title = Abort a merge
|
||||
cards = checkout commit-auto merge merge-abort
|
||||
|
||||
[description]
|
||||
|
||||
Sometimes you want to merge two commits, but a merge conflict occurs that you currently don't want to resolve.
|
||||
|
||||
In these situations you can abort the merge to merge later. Use
|
||||
git merge --abort
|
||||
when you are in a merge process.
|
||||
|
||||
Try to merge both commits and abort the merge afterwards.
|
||||
|
||||
[setup]
|
||||
|
||||
echo "A new day is starting" > you
|
||||
|
||||
git add .
|
||||
git commit -m "Start"
|
||||
|
||||
echo "Walking down the Main Lane." >> you
|
||||
|
||||
git add .
|
||||
git commit -m "Main Lane"
|
||||
|
||||
|
||||
git checkout HEAD~1
|
||||
|
||||
echo "Walking down the Side Lane." >> you
|
||||
|
||||
git add .
|
||||
git commit -m "Side Lane"
|
||||
|
||||
git checkout HEAD~1
|
||||
|
||||
git branch -D main
|
||||
|
||||
[actions]
|
||||
|
||||
if test -f .git/MERGE_HEAD; then
|
||||
touch .git/secretfile
|
||||
fi
|
||||
|
||||
[win]
|
||||
|
||||
# You tried to merge?
|
||||
test -f .git/secretfile
|
||||
|
||||
# You aborted to merge?
|
||||
test -f .git/secretfile && ! test -f .git/MERGE_HEAD && ! git rev-parse HEAD^^
|
||||
|
||||
[congrats]
|
||||
|
||||
Aaah, let's merge later...
|
2
levels/it_IT/merge/sequence
Normal file
2
levels/it_IT/merge/sequence
Normal file
|
@ -0,0 +1,2 @@
|
|||
merge
|
||||
conflict
|
Loading…
Add table
Add a link
Reference in a new issue