Skip to content

Instantly share code, notes, and snippets.

@ivonne-hernandez
Forked from ericweissman/session2_hw_mod0.md
Last active July 16, 2021 14:14
Show Gist options
  • Select an option

  • Save ivonne-hernandez/416f9506c89b820f7d6118d6492bcc2e to your computer and use it in GitHub Desktop.

Select an option

Save ivonne-hernandez/416f9506c89b820f7d6118d6492bcc2e 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):
  • Git commit messages are the best way to communicate context about a change to fellow developers (and indeed to their future selves). A diff will tell you what changed, but only the commit message can properly tell you why
  • Good Git commit messages are concise and consistent.
  • Use the imperative convention "If applied, this git commit will..."
  • When a commit merits a bit of explanation, make sure you write the body in the text editor and include a blank line after the subject line
  • The body should explain what and why, i.e. explain what problem this git commit is solving.
  • In the body: focus on clarifying the reasons why you made the change in the first place, the way things worked before the change (and what was wrong with that), the way they work now, and why you decided to solve it the way you did
  • The terminal will allow you to maximize the power of Git, so make it a habit to include changes here because it's where the code's history is literally being written.

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: Using the staging area is like writing an email and saving it as a draft before you send it out.

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!)
  20. Show the log of your work in oneline format using git log (This will likely require some Googling)

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

~ ························································· at 03:02:53 PM
❯ cd turing

~/turing ·················································· at 03:03:12 PM
❯ mkdir git_homework

~/turing ·················································· at 03:04:04 PM
❯ cd git_homework 

~/turing/git_homework ····································· at 03:04:12 PM
❯ touch thoughts.md

~/turing/git_homework ····································· at 03:04:24 PM
❯ git init
Initialized empty Git repository in /Users/ivonnehernandez/turing/git_homework/.git/

~/turing/git_homework on main ?1 ·························· at 03:04:38 PM
❯ 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)

~/turing/git_homework on main ?1 ·························· at 03:05:10 PM
❯ git add thoughts.md

~/turing/git_homework on main +1 ·························· at 03:05:55 PM
❯ git status
On branch main

No commits yet

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


~/turing/git_homework on main +1 ·························· at 03:06:23 PM
❯ git commit -m "Initial commit"
[main (root-commit) 6073600] Initial commit
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 thoughts.md

~/turing/git_homework on main ····························· at 03:08:41 PM
❯ git status
On branch main
nothing to commit, working tree clean

~/turing/git_homework on main ····························· at 03:08:52 PM
❯ atom thoughts.md 

~/turing/git_homework on main ····························· at 03:09:44 PM
❯ 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")

~/turing/git_homework on main !1 ·························· at 03:12:50 PM
❯ git diff

~/turing/git_homework on main !1 ················· took 26s at 03:13:29 PM
❯ 

~/turing/git_homework on main !1 ·························· at 03:13:29 PM
❯ git add thoughts.md

~/turing/git_homework on main +1 ·························· at 03:14:33 PM
❯ git commit -m "Add two takeaways"     
[main 9495036] Add two takeaways
 1 file changed, 2 insertions(+)

~/turing/git_homework on main ····························· at 03:16:52 PM
❯ git status
On branch main
nothing to commit, working tree clean

~/turing/git_homework on main ····························· at 03:18:07 PM
❯ git add thoughts.md

~/turing/git_homework on main +1 ·························· at 03:21:25 PM
❯ git commit -m "Add two strategies"
[main eed87d1] Add two strategies
 1 file changed, 2 insertions(+)

~/turing/git_homework on main ····························· at 03:21:59 PM
❯ git add thoughts.md               

~/turing/git_homework on main +1 ·························· at 03:25:13 PM
❯ git commit -m "Add a shoutout"     
[main dcd607b] Add a shoutout
 1 file changed, 1 insertion(+)

~/turing/git_homework on main ····························· at 03:26:15 PM
❯ git log --oneline

~/turing/git_homework on main ···················· took 21s at 03:38:43 PM
❯ 

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 all of your homework gists are written in.

Using this markdown cheatsheet, create a new gist of your own by clicking the New Gist button in the upper right-hand corner of the screen.

Also, images can be a little tricky in gists and Github - be sure to check out the drag-n-drop shortcut from the first answer on this Stack Overflow post!

In the box to title your Gist, be sure to use follow this format: firstName_lastName_mod_0_plan.md

NOTE: Remember to add a .md file extension to filename of your new Gist. Otherwise 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 Frontend or in Ruby for Backend)
  • at least one inline code block (greyed text)
  • at least one image
  • ⚡️ 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 read 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 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
@corneliusellen
Copy link

@ivonne-hernandez Great job. I love your git staging metaphor.

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