Homework for 5B

Review

Topics Covered: Git, Github, Ruby Koans, Revisited previous exercises


Exercises

E1: Git Review

  1. What does the git init command do?
  2. What does git add do? How is it different from git commit?
  3. What is the difference between staged and committed (or versioned) files? When might you stage something and not commit it?
  4. What's the shortcut for adding all files and commiting?
  5. How do you unstage a staged file? How do you go back to an old version of a committed file?
  6. Why are commit messages very important?
  7. How do I revert to a previous commit?
  8. How do you exit out of vi? (Also called vim.)

E2: GitHub

  1. What's the difference between GitHub and git? Could git exist without GitHub? Could GitHub exist without git?
  2. Why is GitHub a cool company?
  3. What does git push do?
  4. What does git pull do? How is it different from/same as git fetch and git merge?

E3: Push Push Push!

Now that you know how to create github repos, the next step is to add your API projects on your Github. Initialize a new repo on Github (which should have the same name as your local repo), follow instructions taught in lecture on how to sync up the remote and local repo, add your changes, and push them to your github repo!

E4: Achieve Nirvana on the Ruby Koans

"If a REPL falls in an isolated environment and no one hears, does it make a noise?"

Fun fact, a koan (as defined by Wikipedia) is a story, dialogue, question, or statement, which is used in Zen-practice to provoke the "great doubt", and test a student's progress.

Ruby Koans is not only a great way to learn more about Ruby, it is also a fantastic example of the power of testing. The Koans start off really easy, but keep going. They become increasingly difficult surprisingly quickly. When "great doubts" arise, always remember to persevere until "mountains are again merely mountains".