Part 1: Questions
Mike and Julin will assign you to groups of two or three. With your partner(s) answer these questions. Be prepared to present your answers to everyone.
- What is git vs github/bitbucket?
- What does it mean to stage changes?
- What does it mean to commit changes?
- Why does git separate stage and commit into separate steps?
- What does it mean to push and pull changes?
- Where are the files in your repository stored?
- Do you need to use github when you are using git? If yes, why? If no, why might you want to anyway?
- Why use git? (provide multiple answers)
After discussion of above are there remaining Qs? Please ask!
Part 2: Practice
You have already had some practice with git and github but now lets try it with a partner.
First Mike or Julin will demo adding a collaborator to a github repository.
Now with your partner, complete the exercises below
Partner 1: Create a repository “Favorites”. Add partner 2 as a collaborator. Anybody can clone your public repository, but only collaborators can push code directly to it.
Partner 2: Clone the repository. Create a text file “Foods” that has your name and a favorite food. Stage, commit, and push your changes.
Partner 1: Create a text file “Drinks” that has your name and a favorite drink. Stage, commit, and push your changes.
Partners 1 and 2: pull the changes.
Partner 1: Add your entry to the “Foods” file.
Partner 2: Add your entry to the “Drinks” file.
Partners 1 and 2: Stage, commit, and push your changes. Pull your partners changes and make sure that you have a complete “Foods” and “Drinks” file.