2021-01-07 12:57:31 +01:00
|
|
|
title = Working together
|
2021-02-18 17:29:48 +01:00
|
|
|
cards = pull commit-auto push
|
2021-01-07 12:57:31 +01:00
|
|
|
|
|
|
|
[description]
|
|
|
|
|
2021-02-18 17:29:48 +01:00
|
|
|
Let's add your name to our list of students!
|
2021-02-06 14:42:43 +01:00
|
|
|
|
2021-02-18 17:29:48 +01:00
|
|
|
I already have a second commit of it in my time machine - let's work together!
|
2021-01-07 12:57:31 +01:00
|
|
|
|
2021-02-18 12:39:18 +01:00
|
|
|
[cli]
|
|
|
|
|
2021-02-18 17:29:48 +01:00
|
|
|
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.
|
2021-02-18 16:03:46 +01:00
|
|
|
|
2021-01-07 12:57:31 +01:00
|
|
|
[congrats]
|
|
|
|
|
2021-02-04 13:59:13 +01:00
|
|
|
Welcome to time travel school! :) I'll see you for your first class tomorrow!
|
2021-01-07 12:57:31 +01:00
|
|
|
|
|
|
|
[setup]
|
|
|
|
|
2021-02-04 13:59:13 +01:00
|
|
|
echo "~ List of current students ~" > students
|
2021-01-07 12:57:31 +01:00
|
|
|
git add .
|
|
|
|
git commit -m "Initial version"
|
2021-02-18 17:29:48 +01:00
|
|
|
git push -u teacher main
|
|
|
|
|
|
|
|
[setup teacher]
|
|
|
|
|
|
|
|
git reset --hard main
|
2021-01-07 12:57:31 +01:00
|
|
|
|
|
|
|
echo "
|
2021-02-04 13:59:13 +01:00
|
|
|
- Sam
|
|
|
|
- Alex" >> students
|
2021-01-07 12:57:31 +01:00
|
|
|
|
|
|
|
git add .
|
2021-02-04 13:59:13 +01:00
|
|
|
git commit -m "Added two students"
|
2021-01-07 12:57:31 +01:00
|
|
|
|
|
|
|
[win]
|
|
|
|
|
2021-02-18 17:29:48 +01:00
|
|
|
# Get the second commit from your teacher using `git pull`.
|
|
|
|
test "$(git log --oneline teacher/main | wc -l)" -ge 2
|
2021-01-11 19:16:35 +01:00
|
|
|
|
2021-02-04 13:59:13 +01:00
|
|
|
# Add your name to the list of students
|
|
|
|
test "$(cat students |wc -l)" -ge 5
|
2021-01-07 12:57:31 +01:00
|
|
|
|
2021-01-11 19:16:35 +01:00
|
|
|
# Commit your result.
|
2021-02-04 13:59:13 +01:00
|
|
|
test "$(git show main:students |wc -l)" -ge 5
|
2021-01-11 19:16:35 +01:00
|
|
|
|
2021-02-04 13:59:13 +01:00
|
|
|
[win teacher]
|
2021-01-07 12:57:31 +01:00
|
|
|
|
2021-02-04 13:59:13 +01:00
|
|
|
# And use `git push` to send it to your teacher!
|
|
|
|
test "$(git show main:students |wc -l)" -ge 5
|