Skip to content

Instantly share code, notes, and snippets.

@jusrez
Forked from ameseee/session2_hw_mod0.md
Last active April 11, 2022 14:48
Show Gist options
  • Save jusrez/32378eb14474af924ad5c3a5ab6f1659 to your computer and use it in GitHub Desktop.
Save jusrez/32378eb14474af924ad5c3a5ab6f1659 to your computer and use it in GitHub Desktop.

Session 2 HW

CAREFULLY READ ALL THE INSTRUCTIONS BEFORE STARTING THESE EXERCISES!

To start this assignment:

  1. Click the button in the upper right-hand corner that says Fork. This is now your copy of the document.
  2. Click the Edit button when you're ready to start adding your answers.
  3. To save your work, click the green button in the bottom right-hand corner. You can always come back and re-edit your gist.

Readings + Responses

Git Commit Messages (17 min)

Read this article on git commit messages

  • Your key take-aways OR how you're going to implement specific points (minimum 2):
  • A commit message will signal to other developers if you're a good collaborator or not.
  • Agreeing to using a specified convention for commit messages with your team can greatly impact the success of a project.

The idea of the staging area is frequently one of the trickiest concepts to wrap your head around when you're first learning git. Read the question and answers (or do your own Googling on the git staging area). Then, create your OWN metaphor comparing the staging area to something in real life.

  • Type your metaphor below:

The staging area in git is like the chamber of a gun. The chamber is used to isolate a bullet from the magazine (the magazine would be the working tree) and prepare it to be fired. The bullet here is the change you want to make. The chamber will allow you to separate bullets from the magazine that houses many of them and fire them one at a time (similar to how staging helps you split up one large change into multiple separate commits). You can review your changes by pulling the slide assembly back (to see the chamber) and either ejecting the bullet if something is wrong or confirming it's there before pulling the trigger (similar to how staging lets you review changes before moving forward).

Note: I promise I'm not some NRA gun nut 😆 but learning about Git reminded me a lot of the gun safety training I completed in Navy Boot Camp and how all the various parts of a gun work together to fire a round. Git isn't exactly the same, but conceptually it shares some similarities.

Exercises

1. Git Practice (15 min)

Follow the steps below to practice the git workflow. Be ready to copy-paste your terminal output as confirmation of your practice.

  1. Create a directory called git_homework. Inside of there, create a file called thoughts.md
  2. Initialize the directory
  3. Use git status to ensure you are set up for tracking using Git
  4. Add your thoughts.md to the staging area
  5. Check the git status
  6. Create an initial commit (Note: Be sure to follow the correct message format for your first commit!)
  7. Check the git status
  8. Add two takeaways you've had from your first few classes of Mod 0 as it relates to success at Turing.
  9. Check the git status
  10. Check the changes you've made using git diff
  11. Add the changes to the staging area
  12. Commit the new changes (Note: Be sure to follow convention for commit messages!)
  13. Check the status
  14. Add two new strategies you are committed to trying during the rest of Mod 0 to thoughts.md
  15. Add the changes to the staging area
  16. Commit the new changes (Note: Be sure to follow convention for commit messages!)
  17. Add at least one shoutout to someone who has helped you, supported you, or just been a positive presence in the last two weeks!
  18. Add the changes to the staging area
  19. Commit the new changes (Note: Be sure to follow convention for commit messages!)

Copy and paste all of the terminal text from this process below (not just the history):

/Users/justin  🥴$ls    
Applications	Documents	Library		Music		Public		to_do
Desktop		Downloads	Movies		Pictures	cool_project	turing
/Users/justin  🥴$mkdir git_homework
/Users/justin  🥴$ls
Applications	Documents	Library		Music		Public		git_homework	turing
Desktop		Downloads	Movies		Pictures	cool_project	to_do
/Users/justin  🥴$cd git_homework
/Users/justin/git_homework  🥴$touch thoughts.md
/Users/justin/git_homework  🥴$git init
Initialized empty Git repository in /Users/justin/git_homework/.git/
/Users/justin/git_homework main 🥴$git status
On branch main

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	thoughts.md

nothing added to commit but untracked files present (use "git add" to track)
/Users/justin/git_homework main 🥴$git add thoughts.md
/Users/justin/git_homework main 🥴$git status
On branch main

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)
	new file:   thoughts.md

/Users/justin/git_homework main 🥴$git commit -m "Initial commit"
[main (root-commit) e8e0468] Initial commit
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 thoughts.md
/Users/justin/git_homework main 🥴$git status
On branch main
nothing to commit, working tree clean
/Users/justin/git_homework main 🥴$atom thoughts.md
/Users/justin/git_homework main 🥴$git status
On branch main
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   thoughts.md

no changes added to commit (use "git add" and/or "git commit -a")
/Users/justin/git_homework main 🥴$git diff
diff --git a/thoughts.md b/thoughts.md
index e69de29..a06bfd6 100644
--- a/thoughts.md
+++ b/thoughts.md
@@ -0,0 +1,3 @@
+Takeaways
+--It's more important to be good at working well with others than working well alone.
+--Practice makes perfect.
/Users/justin/git_homework main 🥴$git add thoughts.md
/Users/justin/git_homework main 🥴$git commit -m "Add two takeaways"
[main 84c96ec] Add two takeaways
 1 file changed, 3 insertions(+)
/Users/justin/git_homework main 🥴$git status
On branch main
nothing to commit, working tree clean
/Users/justin/git_homework main 🥴$atom thoughts.md
/Users/justin/git_homework main 🥴$git add thoughts.md
/Users/justin/git_homework main 🥴$git commit -m "Add two strategies"
[main 5491534] Add two strategies
 1 file changed, 4 insertions(+)
/Users/justin/git_homework main 🥴$atom thoughts.md
/Users/justin/git_homework main 🥴$git add thoughts.md
/Users/justin/git_homework main 🥴$git commit -m "Add shoutout"
[main 06ba66a] Add shoutout
 1 file changed, 3 insertions(+)
/Users/justin/git_homework main 🥴$history
  287  git add thoughts.md
  288  git status
  289  git commit -m "Initial commit"
  290  git status
  291  atom thoughts.md
  292  git status
  293  git diff
  294  git add thoughts.md
  295  git commit -m "Add two takeaways"
  296  git status
  297  atom thoughts.md
  298  git add thoughts.md
  299  git commit -m "Add two strategies"
  300  atom thoughts.md
  301  git add thoughts.md
  302  git commit -m "Add shoutout"
/Users/justin/git_homework main 🥴$

IMPORTANT: Do NOT remove this git_homework directory. You will be using this directory during the next session.

2. Markdown Practice (20 min)

Your task: create a "Plan for Mod 0" documenting your gameplan for success in Mod 0, using Markdown.

Markdown (.md) is the format gists are written in, and is commonly used for writing technical documentation. This Markdown Cheatsheet is an excellent resource to learn and reference tips on how to write in Markdown.

Create a new Gist onyour account to get some practice writing Markdown and reading through technical documention such as the resource linked above. In the box to title your Gist, follow this format: firstName_lastName_mod_0_plan.md.

Note: Images can be a little tricky in Gists and GitHub - drag-n-drop shortcut from the first answer on this Stack Overflow post is an additional resource we recommend using!

NOTE: Remember to add a .md file extension to filename of your new Gist. If you don't, it will not register as markdown.

In addition to documenting your gameplan for success in Mod 0, incorporate each of the following features into your Gist:

  • at least two headings of different sizes
  • at least one numbered list
  • at least one bullet point list
  • at least one bold word/phrase
  • at least one italic word/phrase
  • at least one code block (in JavaScript for Front-End or in Ruby for Back-End)
  • at least one inline code block (greyed text)
  • at least one image
  • ⚡️ Using your new skills, TURN THIS SENTENCE INTO A LINK TO YOUR GIST ⚡️

Self Assess

Using the rubric below, assess how you did with these exercises. These are the same metrics your instructors will use to determine if you are prepared for Mod 1!

  • I carefully read ALL directions
  • I completed all parts of the exercises (not including Extensions) to the best of my ability
  • I used correct syntax, spacing and naming conventions
  • I followed ALL formatting instructions
  • I pushed myself out of my comfort zone and experimented/broke things to try to learn
  • I spent no longer than 20-30 mins Googling a specific problem before asking for help
  • I went back to the lesson to search for clarification before asking for help

Questions/Comments/Confusions

If you have any questions, comments, or confusions that you would like an instructor to address, list them below:

Stuck? Having Issues?

Are you stuck on something? Here is the BEST way to ask for help:

  • Start or reply in the thread with the problem you are facing. Be sure to follow the guidelines for asking questions below:
    • I can explain what I am trying to do or accomplish
    • I can explain what I have tried so far and/or what resources I've tried online
    • I can describe specifically what I am stuck on
    • I provided screenshots and/or code examples to give context
      • If I provided short code examples, I used inline code formatting for single lines of code/error messages
      • If I provided larger blocks of code, I used a code snippet in the correct format (such as .js or .rb)
  • Usually, your classmates will be able to answer your question or point you in the right direction very quickly! If not, an instructor will reply within 24-48 hours
@kaitvan
Copy link

kaitvan commented Apr 11, 2022

Justin... honestly, I was a little freaked out at first by your git staging area metaphor. Thanks for your thoughtful explanation and your comment about where that came from. I feel better now. And it's a good metaphor. 🙂

Your git workflow shows strong mastery of both the git workflow process and the purpose of each command. Well done! Overall, your markdown file is strong as well. Just one thing to improve there and I'll put that feedback below.

  • You missed the inline code block. The ruby code block with three backtics (```) is used for a long block of ruby code, but the inline code block is meant for when you want to highlight only a short snippet of code inside of a paragraph. For example, if you were referencing the name of a variable or a method in a longer sentence, you might put it in an inline code block to make it stand out as code rather than a part of the sentence. To make the inline code block, just use one backtic on either side of the word or phrase you want to highlight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment