oh-my-git/levels/intro/remote

53 lines
1.1 KiB
Text
Raw Normal View History

title = Working together
2021-02-18 17:29:48 +01:00
cards = pull commit-auto push
[description]
2021-02-18 17:29:48 +01:00
Let's add your name to our list of students!
2021-02-18 17:29:48 +01:00
I already have a second commit of it in my time machine - let's work together!
[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.
[congrats]
2021-02-04 13:59:13 +01:00
Welcome to time travel school! :) I'll see you for your first class tomorrow!
[setup]
2021-02-04 13:59:13 +01:00
echo "~ List of current students ~" > students
git add .
git commit -m "Initial version"
2021-02-18 17:29:48 +01:00
git push -u teacher main
git update-ref -d refs/remotes/teacher/main
2021-02-18 17:29:48 +01:00
[setup teacher]
git reset --hard main
echo "
2021-02-04 13:59:13 +01:00
- Sam
- Alex" >> students
git add .
2021-02-04 13:59:13 +01:00
git commit -m "Added two students"
[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-02-04 13:59:13 +01:00
# Add your name to the list of students
test "$(cat students |wc -l)" -ge 5
# Commit your result.
2021-02-04 13:59:13 +01:00
test "$(git show main:students |wc -l)" -ge 5
2021-02-04 13:59:13 +01:00
[win teacher]
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