Skip to content

Instantly share code, notes, and snippets.

@isleofyou
Forked from ericweissman/session2_hw_mod0.md
Last active July 27, 2021 17:08
Show Gist options
  • Save isleofyou/f99daaa18aac1a0c05f02da0fa3f6819 to your computer and use it in GitHub Desktop.
Save isleofyou/f99daaa18aac1a0c05f02da0fa3f6819 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):
  • Good commit messages help maintainers in the long run by being clear and concise.
  • Proper formatting is very important. Space between the subject and body, subject needs 1st letter capitalized and no period

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:

There's a table full of Thanksgiving leftoevers at your mom's house. You have a container. You fill up your container with all the food you want. Then you seal it and write your name on it so everyone knows it's yours.

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):

Last login: Tue Jul 20 18:07:59 on ttys000
/Users/davidtran  $pwd
/Users/davidtran
/Users/davidtran  $ls
Applications	Downloads	Music		cool_project
Desktop		Library		Pictures	to_do
Documents	Movies		Public
/Users/davidtran  $mkdir git_homework
/Users/davidtran  $cd git_homework 
/Users/davidtran/git_homework  $touch thoughts.md 
/Users/davidtran/git_homework  $git init
Initialized empty Git repository in /Users/davidtran/git_homework/.git/
/Users/davidtran/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/davidtran/git_homework main $git commit -m "Initial commit"
On branch main

Initial commit

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/davidtran/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/davidtran/git_homework main $git add                       
Nothing specified, nothing added.
hint: Maybe you wanted to say 'git add .'?
hint: Turn this message off by running
hint: "git config advice.addEmptyPathspec false"
/Users/davidtran/git_homework main $git add thoughts.md
/Users/davidtran/git_homework main $git commit -m "Initial commit"
[main (root-commit) 38f8774] Initial commit
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 thoughts.md
/Users/davidtran/git_homework main $git status
On branch main
nothing to commit, working tree clean
/Users/davidtran/git_homework main $atom thoughts.md
/Users/davidtran/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/davidtran/git_homework main $git diff
diff --git a/thoughts.md b/thoughts.md
index e69de29..ba3085a 100644
--- a/thoughts.md
+++ b/thoughts.md
@@ -0,0 +1,2 @@
+Use your time wisely
+A good calendar will help you stay on track
/Users/davidtran/git_homework main $git add
Nothing specified, nothing added.
hint: Maybe you wanted to say 'git add .'?
hint: Turn this message off by running
hint: "git config advice.addEmptyPathspec false"
/Users/davidtran/git_homework main $git add thoughts.md
/Users/davidtran/git_homework main $git commit -m "First 2 lines added"
[main 9bf34d2] First 2 lines added
 1 file changed, 2 insertions(+)
/Users/davidtran/git_homework main $git status
On branch main
nothing to commit, working tree clean
/Users/davidtran/git_homework main $git add touch.md
fatal: pathspec 'touch.md' did not match any files
/Users/davidtran/git_homework main $commit -m "Second 2 lines added"
zsh: command not found: commit
/Users/davidtran/git_homework main $git add touch.md
fatal: pathspec 'touch.md' did not match any files
/Users/davidtran/git_homework main $commit -m "Shout out to Jimmy added"
zsh: command not found: commit
/Users/davidtran/git_homework main $git log
commit 9bf34d269bd090053237dbee51271a9dcac7dea6 (HEAD -> main)
Author: David Tran <[email protected]>
Date:   Thu Jul 22 16:30:58 2021 -0600

    First 2 lines added

commit 38f87747279a4011976f9fc6a10380497f764145
Author: David Tran <[email protected]>
Date:   Thu Jul 22 16:28:27 2021 -0600

    Initial commit
/Users/davidtran/git_homework main $git log --pretty=oneline
9bf34d269bd090053237dbee51271a9dcac7dea6 (HEAD -> main) First 2 lines added
38f87747279a4011976f9fc6a10380497f764145 Initial commit
/Users/davidtran/git_homework main $git commit -m "Shout out to Jimmy added"
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/davidtran/git_homework main $git add thoughts.md
/Users/davidtran/git_homework main $git diff
/Users/davidtran/git_homework main $git diff
/Users/davidtran/git_homework main $git log
commit 9bf34d269bd090053237dbee51271a9dcac7dea6 (HEAD -> main)
Author: David Tran <[email protected]>
Date:   Thu Jul 22 16:30:58 2021 -0600

    First 2 lines added

commit 38f87747279a4011976f9fc6a10380497f764145
Author: David Tran <[email protected]>
Date:   Thu Jul 22 16:28:27 2021 -0600

    Initial commit
/Users/davidtran/git_homework main $git status
On branch main
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   thoughts.md

/Users/davidtran/git_homework main $git commit -m thoughts.md
[main 1d17bd0] thoughts.md
 1 file changed, 3 insertions(+)
/Users/davidtran/git_homework main $git diff
/Users/davidtran/git_homework main $git status
On branch main
nothing to commit, working tree clean
/Users/davidtran/git_homework main $git git log --pretty-oneLine
git: 'git' is not a git command. See 'git --help'.

The most similar command is
	init
/Users/davidtran/git_homework main $git log --pretty=oneline
1d17bd0c6d5ccc54e6eff010f87640f4ccd770a6 (HEAD -> main) thoughts.md
9bf34d269bd090053237dbee51271a9dcac7dea6 First 2 lines added
38f87747279a4011976f9fc6a10380497f764145 Initial commit
/Users/davidtran/git_homework main $git add thoughts.md
/Users/davidtran/git_homework main $git diff
diff --git a/thoughts.md b/thoughts.md
index 93145fa..7172f1c 100644
--- a/thoughts.md
+++ b/thoughts.md
@@ -2,4 +2,4 @@ Use your time wisely
 A good calendar will help you stay on track
 Frequent Pomodoro breaks
 Using Pseudocode to make a task more manageable
-Shout out to alumni Jimmy Truong giving me confidence!
+Shout out to alumni Jimmy Truong for the confidence boost!
/Users/davidtran/git_homework main $git commit -m "Updated shout out"
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/davidtran/git_homework main $git statu
git: 'statu' is not a git command. See 'git --help'.

The most similar commands are
	status
	stage
	stash
/Users/davidtran/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/davidtran/git_homework main $git diff   
diff --git a/thoughts.md b/thoughts.md
index 93145fa..7172f1c 100644
--- a/thoughts.md
+++ b/thoughts.md
@@ -2,4 +2,4 @@ Use your time wisely
 A good calendar will help you stay on track
 Frequent Pomodoro breaks
 Using Pseudocode to make a task more manageable
-Shout out to alumni Jimmy Truong giving me confidence!
+Shout out to alumni Jimmy Truong for the confidence boost!
/Users/davidtran/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/davidtran/git_homework main $git add thoughts.md
/Users/davidtran/git_homework main $git diff
diff --git a/thoughts.md b/thoughts.md
index 7172f1c..7b00b46 100644
--- a/thoughts.md
+++ b/thoughts.md
@@ -2,4 +2,4 @@ Use your time wisely
 A good calendar will help you stay on track
 Frequent Pomodoro breaks
 Using Pseudocode to make a task more manageable
-Shout out to alumni Jimmy Truong for the confidence boost!
+Shout-out to alumni Jimmy Truong for the confidence boost!
/Users/davidtran/git_homework main $git commit -m "Add hyphen to shout-out"
[main ff8c86c] Add hyphen to shout-out
 1 file changed, 1 insertion(+), 1 deletion(-)
/Users/davidtran/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/davidtran/git_homework main $git log --pretty=oneline
ff8c86ca01e308c7d5b322dada2fea34d23597e9 (HEAD -> main) Add hyphen to shout-out
1d17bd0c6d5ccc54e6eff010f87640f4ccd770a6 thoughts.md
9bf34d269bd090053237dbee51271a9dcac7dea6 First 2 lines added
38f87747279a4011976f9fc6a10380497f764145 Initial commit
/Users/davidtran/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 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
@stellakunzang
Copy link

Hi David,
Looks like you did a very thorough job with the git practice and overcame some error messages. Great work moving through the challenges. I don't see a link to your markdown assignment. Can you add it and send me a DM once it has been added so I can update your grade?

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