Skip to content

Instantly share code, notes, and snippets.

@chrissycooper
Last active November 8, 2022 02:05
Show Gist options
  • Select an option

  • Save chrissycooper/cda580d274293e4e80ce773bedab1728 to your computer and use it in GitHub Desktop.

Select an option

Save chrissycooper/cda580d274293e4e80ce773bedab1728 to your computer and use it in GitHub Desktop.

Git - Check For Understanding

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 edit your gist.
  4. Remember to use the Preview button to check your markdown formatting before submitting this assignment.

Git Workflow

Follow the steps below to practice the Git workflow. Be ready to copy-and-paste your Terminal output as confirmation of your work.

  1. Create a directory called git_cfu. Inside of that directory, 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 hours 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 --oneline.

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

Last login: Mon Nov  7 17:32:42 on ttys000
chrissy@CRs-MacBook-Pro ~ % ls
Applications		Library			Pictures
Desktop			Mod_0_Assignments	Public
Documents		Movies
Downloads		Music
chrissy@CRs-MacBook-Pro ~ % cd mod_0_assignments
chrissy@CRs-MacBook-Pro mod_0_assignments % ls
code_101		to_do			vs_code_practice
home			turing_work
chrissy@CRs-MacBook-Pro mod_0_assignments % mkdir git_cfu
chrissy@CRs-MacBook-Pro mod_0_assignments % cd git_cfu
chrissy@CRs-MacBook-Pro git_cfu % touch thoughts.md
chrissy@CRs-MacBook-Pro git_cfu % ls
thoughts.md
chrissy@CRs-MacBook-Pro git_cfu % pwd     
/Users/chrissy/mod_0_assignments/git_cfu
chrissy@CRs-MacBook-Pro git_cfu % git init
Initialized empty Git repository in /Users/chrissy/Mod_0_Assignments/git_cfu/.git/
chrissy@CRs-MacBook-Pro git_cfu % 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)
chrissy@CRs-MacBook-Pro git_cfu % git add toughts.md
fatal: pathspec 'toughts.md' did not match any files
chrissy@CRs-MacBook-Pro git_cfu % git add thoughts.md
chrissy@CRs-MacBook-Pro git_cfu % git status
On branch main

No commits yet

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

chrissy@CRs-MacBook-Pro git_cfu % git commit -m "Initial commit"
[main (root-commit) 2c6e2e5] Initial commit
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 thoughts.md
chrissy@CRs-MacBook-Pro git_cfu % git status
On branch main
nothing to commit, working tree clean
chrissy@CRs-MacBook-Pro git_cfu % code .
chrissy@CRs-MacBook-Pro git_cfu % 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")
chrissy@CRs-MacBook-Pro git_cfu % git diff
diff --git a/thoughts.md b/thoughts.md
index e69de29..d2dd4d8 100644
--- a/thoughts.md
+++ b/thoughts.md
@@ -0,0 +1,4 @@
+# Takeways
+1. I noticed that I definitely started to fatigue at some point in the day. It really helped me to take a moment to stand up in between assignments sections and walk around a bit, or get a cup of tea. 
+1. I've been taking careful notes of shortcuts. There are **so many** shortcuts! It's been useful to have them stored on a sheet of paper separate from my notebook. I'm going to make a little booklet to keep on my desk until I have them committed to my memory. 
+
chrissy@CRs-MacBook-Pro git_cfu % git add thoughts.md
chrissy@CRs-MacBook-Pro git_cfu % git commit -m "add two takeaways"
[main 98f929a] add two takeaways
 1 file changed, 4 insertions(+)
chrissy@CRs-MacBook-Pro git_cfu % git commit -m "Add two takeaways"
On branch main
nothing to commit, working tree clean
chrissy@CRs-MacBook-Pro git_cfu % git status
On branch main
nothing to commit, working tree clean
chrissy@CRs-MacBook-Pro git_cfu % git add thoughts.md
chrissy@CRs-MacBook-Pro git_cfu % git commit -m "Add two strategies"
[main 13c3556] Add two strategies
 1 file changed, 5 insertions(+)
chrissy@CRs-MacBook-Pro git_cfu % git add thoughts.md
chrissy@CRs-MacBook-Pro git_cfu % git status
On branch main
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   thoughts.md

chrissy@CRs-MacBook-Pro git_cfu % git commit -m "Add shoutouts"
[main 8e259d3] Add shoutouts
 1 file changed, 3 insertions(+)
chrissy@CRs-MacBook-Pro git_cfu % git log --oneline
8e259d3 (HEAD -> main) Add shoutouts
13c3556 Add two strategies
98f929a add two takeaways
2c6e2e5 Initial commit
chrissy@CRs-MacBook-Pro git_cfu %                  

Self-Reflection

Please respond to the following questions in writing directly in this Gist.

  • How confident do you feel in your understanding and fluency with the Git workflow? I feel moderately confident in my understanding of the Git workflow for the amount of time we spent with it so far. I appreciated how many times we went through it in practice, and that I could watch the video back. I am definitely still getting better at remembering what to do when. I'm getting the hang of the general rhythm.

  • What do you still need to practice or learn? How will you do that? I still need to practice reading the feedback messages. Perhaps I will try out my own test project without the step-by-step to see where I get tripped up, and practice using the feedback to determine where to go.

  • What part of the Git Workflow is still confusing for you? Interestingly, I kept finding myself expecting the commands to be more specific. For example, every time I wrote git init I expected to add the directory name after it. Same with git commit -m " ", I expected to put the file name in between that command and the message portion of the command. It does make sense to me that the staging area works this way. I need to review the staging area. Do all the files and directories that have been added to the staging area get committed all at once? (if for example you had added instances of them along the way?) I have to say I really liked the analogy to runners at the starting blocks before a race. It was helpful to imagine the files stretching and going through their pre-race rituals. I need a few more examples that are related to actual living projects for me to really grasp this concept, but I'm sure there will be more chances for this coming up!

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