oh-my-git/levels/time-machine/pull-push

52 lines
1.5 KiB
Text
Raw Permalink Normal View History

2020-10-22 16:19:22 +02:00
title = Helping each other
cards = checkout commit-auto reset-hard pull push
2020-10-22 16:19:22 +02:00
2020-10-22 14:36:59 +02:00
[description]
The events and timelines you see are always only what your own time machine knows about!
2020-10-22 17:27:54 +02:00
Of course, time agents don't have to work alone! Here, your sidekick has already prepared a merge for you! You can use the "pull" card to transfer it to your own time machine.
2020-10-22 14:36:59 +02:00
2020-10-29 20:02:43 +01:00
Then, add another event on top (what does Sam have for dinner?), and `push` the result, to transfer it back to your sidekick!
2020-10-22 14:36:59 +02:00
2020-10-29 20:02:43 +01:00
You can only ever manipulate things in your own time machine (the one on the bottom).
2020-10-22 17:27:54 +02:00
2020-10-22 14:36:59 +02:00
[setup yours]
2020-10-29 20:02:43 +01:00
echo "Just woke up. Is hungry." > sam
2020-10-22 14:36:59 +02:00
git add .
git commit -m "The beginning"
git checkout -b pancakes
2020-10-29 20:02:43 +01:00
echo "Had blueberry pancakes with maple syrup for breakfast." > sam
2020-10-22 14:36:59 +02:00
git add .
git commit -m "Pancakes!"
git checkout -b muesli main
2020-10-29 20:02:43 +01:00
echo "Had muesli with oats and strawberries for breakfast." > sam
2020-10-22 14:36:59 +02:00
git add .
git commit -m "Muesli!"
git checkout main
git push -u sidekick main pancakes muesli
[setup sidekick]
git checkout main
git merge pancakes
git merge muesli
2020-10-29 20:02:43 +01:00
echo "Had pancakes with strawberries for breakfast." > sam
2020-10-22 14:36:59 +02:00
git add .
git commit -m "Let's make this breakfast compromise" --author="Sidekick <sidekick@example.com>"
[win sidekick]
# Below main's parent, there is a rhombus:
git rev-parse main^^ && test "$(git rev-parse main^^1^)" = "$(git rev-parse main^^2^)"
2020-10-22 17:27:54 +02:00
[congrats]
In reality, in many cases, a lot of time agents work together to build a really good future together! :)