Scenario 1: Sharing a new project
- Do GitHub CLI setup
- [WORKSHEET] run through 1-3
- create remote-sample/ and open in Visual Studio Code
- Create test.py. print(“We are going to share our new repository”)
- git init
- git add . + git commit
- Create a “blank remote repo”. Go to github.com, new, remote-sample as name
- Show “success” page
- Comment on public vs. private
- copy the “…push an existing repository from the command line”
- View the remote repo in the browser
- [WORKSHEET] run through 4-6
Subsequent versions
- test test.py
- add and commit
- git log. Point out local repo vs. remote repo
- [WORKSHEET] add local main and remote main to pg 2 top picture
- git push
- [WORKSHEET] add 2nd version to remote, update main refs, label git push arrow
- Refresh the browser. Show the history.
- [WORKSHEET] fill bottom of page 2.
Scenario 2: Clone an existing project
- [WORKSHEET] Walk through 1-3
- Have students open https://github.com/llayman/git-remote-clone in browser.
- Terminal, cd into seng-201
- git clone https://github.com/llayman/git-remote-clone
- [WORKSHEET] Fill in drawing
- Create workspace folder, then local repo.
- Right to left. Cloned version into local. Link remote main to local main.
- Clone Version into workspace.
- [WORKSHEET] Fill in bottom.
- DO NOT EDIT FILES YET.
Scenario 3: Retrieving changes.
- [WORKSHEET] Explain the scenario at top.
- Or, scenario where a teammate makes a change.
- [YOU CODE] Edit git-remote-clone/hello.py and push a new version.
- Have students refresh the repo in their browser.
- [WORKSHEET] add main refs to the top.
- Have everyone run git pull. Point out how the code changes.
- Run git log
- [WORKSHEET] Fill out the middle bullet points and the bottom diagram.