mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-09 05:02:22 +02:00
More polish, hide unfinished chapters/levels
This commit is contained in:
parent
be45b82e41
commit
5df4932ad5
19 changed files with 48 additions and 55 deletions
levels/remotes
|
@ -1,33 +0,0 @@
|
|||
title = Adding a remote
|
||||
cards = checkout
|
||||
|
||||
[description]
|
||||
|
||||
Let's work together with others! Your friend has their own repo at the URL `../friend` - you can add it using
|
||||
|
||||
git remote add [name] [URL]
|
||||
|
||||
where `[name]` is an arbitrary, short name you pick for the remote.
|
||||
|
||||
When you've done that, you can get all commits from that remote using
|
||||
|
||||
git pull friend
|
||||
|
||||
There's a letter for you!
|
||||
|
||||
[setup]
|
||||
|
||||
git remote remove friend
|
||||
|
||||
[setup friend]
|
||||
|
||||
echo "I'm really committed to our friendship! <3" > love_letter
|
||||
git add .
|
||||
git commit -m "Write a letter"
|
||||
|
||||
[win]
|
||||
|
||||
# Add a remote that points to ../friend.
|
||||
git remote -v | grep '../friend'
|
||||
# Pull from the remote.
|
||||
git show HEAD:love_letter | grep committed
|
|
@ -1,5 +1,5 @@
|
|||
title = Fetching from remotes
|
||||
cards = checkout
|
||||
cards = checkout fetch commit-auto
|
||||
|
||||
[description]
|
||||
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
title = Helping each other
|
||||
cards = checkout commit-auto reset-hard pull push
|
||||
|
||||
[description]
|
||||
|
||||
The events and timelines you see are always only what your own time machine knows about!
|
||||
|
||||
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.
|
||||
|
||||
Then, add another event on top (what does Sam have for dinner?), and `push` the result, to transfer it back to your sidekick!
|
||||
|
||||
You can only ever manipulate things in your own time machine (the one on the bottom).
|
||||
|
||||
[setup yours]
|
||||
|
||||
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!"
|
||||
|
||||
git checkout -b muesli main
|
||||
echo "Had muesli with oats and strawberries for breakfast." > sam
|
||||
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
|
||||
|
||||
echo "Had pancakes with strawberries for breakfast." > sam
|
||||
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^)"
|
||||
|
||||
[congrats]
|
||||
|
||||
In reality, in many cases, a lot of time agents work together to build a really good future together! :)
|
|
@ -1,23 +0,0 @@
|
|||
title = Deleting and renaming a remote
|
||||
cards = checkout
|
||||
|
||||
[description]
|
||||
|
||||
Here, you already have two remotes configured! You can list them using `git remote`.
|
||||
|
||||
[setup]
|
||||
|
||||
git remote rename friend frend
|
||||
|
||||
[setup friend]
|
||||
|
||||
[setup enemy]
|
||||
|
||||
[win]
|
||||
|
||||
# Rename the remote with the typo (using `git remote rename [old name] [new name]`)
|
||||
git remote | grep friend
|
||||
# The remote with the typo is gone.
|
||||
! grep 'frend' <(git remote)
|
||||
# Delete the remote you don't want to keep (using `git remote remove [remote]`)
|
||||
! grep 'enemy' <(git remote)
|
|
@ -1,3 +1,3 @@
|
|||
add
|
||||
rename-delete
|
||||
friend
|
||||
problems
|
||||
fetch
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue