Git Workflow

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 home 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 VS Code 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 VS Code, 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.


Check For Understanding

Please respond to the following questions by adding them to your Mod 0 Gist in a section entitled Git Workflow

  1. How confident do you feel in your understanding and fluency with the Git workflow?
  2. What do you still need to practice or learn? How will you do that?
  3. What part of the Git Workflow is still confusing for you?

Additional Resources (Optional)




Back