oh-my-git/levels/intro/en/remote

52 lines
1.1 KiB
Text

title = Working together
cards = pull commit-auto push
[description]
Let's add your name to our list of students!
I already have a second commit of it in my time machine - let's work together!
[cli]
To go back to old commands, you can press arrow up and down. That way, you don't have to type in long commands twice.
[congrats]
Welcome to time travel school! :) I'll see you for your first class tomorrow!
[setup]
echo "~ List of current students ~" > students
git add .
git commit -m "Initial version"
git push -u teacher main
git update-ref -d refs/remotes/teacher/main
[setup teacher]
git reset --hard main
echo "
- Sam
- Alex" >> students
git add .
git commit -m "Added two students"
[win]
# Get the second commit from your teacher using `git pull`.
test "$(git log --oneline teacher/main | wc -l)" -ge 2
# Add your name to the list of students
test "$(cat students |wc -l)" -ge 5
# Commit your result.
test "$(git show main:students |wc -l)" -ge 5
[win teacher]
# And use `git push` to send it to your teacher!
test "$(git show main:students |wc -l)" -ge 5