Git

Back

Learning Goals

  • Explain the purpose of Git
  • Use Git to initialize a repository, add and commit changes, and check the status of changes

Video

Watch this video, and take notes throughout, to learn about the purpose of Git and see the workflow modeled several times.

Stop at the provided prompts to take notes and complete practice exercises as instructed.

Practice

Exercise 1

  1. Navigate to your root directory.
  2. If you have a Turing and/or Mod 0 directory, navigate to that (highly recommended)!
  3. Create a new directory called to_do. Inside of that directory, create a file called tasks.md.
  4. Initialize Git inside of the to_do directory so that we have Git available to track changes.
  5. Before you check the status, predict what it will say. Then, check the current status.
  6. Add tasks.md to the staging area.
  7. Make your first commit in this directory.
  8. Before you check the status, predict what it will say. Then, check the current status.
  9. Use Atom to add three separate tasks to tasks.md.
  10. Before you check the status, predict what it will say. Then, check the current status.
  11. Before you check the difference between your last commit and what the file looks like now, predict what it will say. Then, check the diff.
  12. Add the changes to the staging area.
  13. Before you check the status, predict what it will say. Then, check the current status.
  14. Commit the changes using a properly formatted commit message.
  15. Before you check the status, predict what it will say. Then, check the current status.


Exercise 2

Before you run each Git command, pause and predict what the output, if any, will be.

  1. Create a new directory called code_101. Inside of that directory, create a file called learning_code.md.
  2. Initialize Git inside of the code_101 directory so that we have Git available to track change.
  3. Before you check the status, predict what it will say. Then, check the current status.
  4. Add learning_code.md to the staging area.
  5. Commit your work.
  6. In Atom, create a header and either a fact or question about Ruby or JavaScript in the learning_code.md file.
  7. Add the changes to the staging area.
  8. Commit the changes using a properly formatted commit message.
  9. Create a directory inside of code_101 titled practice. Inside of that, create 3 files - you choose the names.
  10. Add some content to each of the three files inside the practice directory.
  11. Add and commit your changes.
  12. Check the status to ensure you have a clean working tree.


Additional Resources (Optional)

Check For Understanding

Follow the directions in this Gist and submit your fork of it in the submission form.




Back