Skip to content

Instantly share code, notes, and snippets.

@MarchandMD
Forked from ameseee/git_cfu.md
Last active July 7, 2022 23:45
Show Gist options
  • Select an option

  • Save MarchandMD/2324138420a77ca00d5a55ee553567fe to your computer and use it in GitHub Desktop.

Select an option

Save MarchandMD/2324138420a77ca00d5a55ee553567fe 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 re-edit your gist.

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 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 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 (This is new, yep!)

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

/Users/michaelmarchand/Documents/Turing  $cd git_homework
cd: no such file or directory: git_homework
/Users/michaelmarchand/Documents/Turing  $mkdir git_homework
/Users/michaelmarchand/Documents/Turing  $cd git_homework
/Users/michaelmarchand/Documents/Turing/git_homework  $
touch thoughts.md
/Users/michaelmarchand/Documents/Turing/git_homework  $
git init
Initialized empty Git repository in /Users/michaelmarchand/Documents/Turing/git_homework/.git/
/Users/michaelmarchand/Documents/Turing/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/Users/michaelmarchand/Documents/Tur/Users/michaelmarchand/Documents/Turing/git_homework main $clear

/Users/michaelmarchand/Documents/Turing/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/michaelmarchand/Documents/Turing/git_homework main $git add .
/Users/michaelmarchand/Documents/Turing/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/michaelmarchand/Documents/Turing/git_homework main $git commit -m 'initial commit'
[main (root-commit) 9f2d0c8] initial commit
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 thoughts.md
/Users/michaelmarchand/Documents/Turing/git_homework main $git status
On branch main
nothing to commit, working tree clean
/Users/michaelmarchand/Documents/Turing/git_homework main $atom thoughts.md
/Users/michaelmarchand/Documents/Turing/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/michaelmarchand/Documents/Turing/git_homework main $git diff
diff --git a/thoughts.md b/thoughts.md
index e69de29..5a84d8f 100644
--- a/thoughts.md
+++ b/thoughts.md
@@ -0,0 +1,2 @@
+1. this is exciting stuff!
+2. terminal makes things faster!
\ No newline at end of file
/Users/michaelmarchand/Documents/Turing/git_homework main $git add .
/Users/michaelmarchand/Documents/Turing/git_homework main $git commit -m 'Adds new thoughts'
[main cdb9d57] Adds new thoughts
 1 file changed, 2 insertions(+)
/Users/michaelmarchand/Documents/Turing/git_homework main $git status
On branch main
nothing to commit, working tree clean
/Users/michaelmarchand/Documents/Turing/git_homework main $git add .
/Users/michaelmarchand/Documents/Turing/git_homework main $git commit -m 'Adds new strategies'   
[main 8aab0a2] Adds new strategies
 1 file changed, 5 insertions(+), 1 deletion(-)
/Users/michaelmarchand/Documents/Turing/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/michaelmarchand/Documents/Turing/git_homework main $git add .
/Users/michaelmarchand/Documents/Turing/git_homework main $git status
On branch main
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   thoughts.md

/Users/michaelmarchand/Documents/Turing/git_homework main $git commit - 'Adds kudos to positive influence'
error: pathspec '-' did not match any file(s) known to git
error: pathspec 'Adds kudos to positive influence' did not match any file(s) known to git
/Users/michaelmarchand/Documents/Turing/git_homework main $

Self Evaluation

How confident do you feel in your understanding and fluency with the Git workflow?

medium confidence for understanding and fluency

What do you still need to practice or learn? How will you do that? Do you need to adjust your calendar in order to do that?

  • practice/learn: additional commands available
  • how to practice/learn: through experience and on an as-needed basis
  • no

What questions do you still have? How will you get the answers you need?

  • none at this time
  • ask
@Oxalisviolacea
Copy link

Alt Text

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