R Club

Git and Github questions and practice

due by: 2016-01-26

posted by: Julin Maloof and Mike Covington

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.

  1. What is git vs github/bitbucket?
  2. What does it mean to stage changes?
  3. What does it mean to commit changes?
  4. Why does git separate stage and commit into separate steps?
  5. What does it mean to push and pull changes?
  6. Where are the files in your repository stored?
  7. Do you need to use github when you are using git? If yes, why? If no, why might you want to anyway?
  8. 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.

comments powered by Disqus