Skip to content

Instantly share code, notes, and snippets.

@James-E-White
Forked from ameseee/git_cfu.md
Last active July 9, 2022 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save James-E-White/0f018a0148f8c30677108d3facfe62b2 to your computer and use it in GitHub Desktop.
Save James-E-White/0f018a0148f8c30677108d3facfe62b2 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):

Last login: Thu Jul  7 20:17:03 on ttys000
/Users/jameswhite  $🐺cd git_cfo
/Users/jameswhite/git_cfo main $🐺git status
On branch main
nothing to commit, working tree clean
/Users/jameswhite/git_cfo main $🐺atom .
/Users/jameswhite/git_cfo main $🐺git status
On branch main
nothing to commit, working tree clean
/Users/jameswhite/git_cfo main $🐺git status
On branch main
nothing to commit, working tree clean
/Users/jameswhite/git_cfo main $🐺git add typing.md           
/Users/jameswhite/git_cfo main $🐺git commit -m"Update all"
On branch main
nothing to commit, working tree clean
/Users/jameswhite/git_cfo main $🐺ls -a
.		..		.git		thoughts.md	typing.md
/Users/jameswhite/git_cfo main $🐺cd ..
/Users/jameswhite  $🐺ls
Applications		Movies			my_other_projects
Desktop			Music			to_do
Documents		Pictures		work_project
Downloads		Public			work_spreadsheets
Library			code_101
Mod0			git_cfo
/Users/jameswhite  $🐺ls -a
.			.ssh			Mod0
..			.viminfo		Movies
.CFUserTextEncoding	.vscode			Music
.DS_Store		.zcompdump		Pictures
.Trash			.zsh_history		Public
.atom			.zsh_sessions		code_101
.gitconfig		.zshrc			git_cfo
.lesshst		Applications		my_other_projects
.npm			Desktop			to_do
.nvm			Documents		work_project
.rbenv			Downloads		work_spreadsheets
.ruby-version		Library
/Users/jameswhite  $🐺git status
fatal: not a git repository (or any of the parent directories): .git
/Users/jameswhite  $🐺cd git_cfo
/Users/jameswhite/git_cfo main $🐺git status
On branch main
nothing to commit, working tree clean
/Users/jameswhite/git_cfo main $🐺git add thoughts.md
/Users/jameswhite/git_cfo main $🐺git status
On branch main
nothing to commit, working tree clean
/Users/jameswhite/git_cfo main $🐺
/Users/jameswhite/git_cfo main $🐺touch file.md
/Users/jameswhite/git_cfo main $🐺git add file.md          
/Users/jameswhite/git_cfo main $🐺git status
On branch main
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	new file:   file.md

/Users/jameswhite/git_cfo main $🐺
  [Restored Jul 8, 2022 at 5:45:02 PM]
Last login: Fri Jul  8 17:44:58 on console
Restored session: Thu Jul  7 21:08:40 PDT 2022
2022-07-08 17:45:11.329 xcodebuild[1426:8988] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-07-08 17:45:11.329 xcodebuild[1426:8988] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
/Users/jameswhite/git_cfo main $🐺cd ..
/Users/jameswhite  $🐺ln -s /Applications/Atom.app/Contents/Resources/app/atom.sh /usr/local/bin/atom
ln: /usr/local/bin/atom: File exists
/Users/jameswhite  $🐺cd
/Users/jameswhite  $🐺ls
Applications		Movies			my_other_projects
Desktop			Music			to_do
Documents		Pictures		work_project
Downloads		Public			work_spreadsheets
Library			code_101
Mod0			git_cfo
/Users/jameswhite  $🐺cd .
/Users/jameswhite  $🐺cd ..
/Users  $🐺ls
Shared		jameswhite
/Users  $🐺cd shared
/Users/shared  $🐺ls
SC Info
/Users/shared  $🐺cd ..
/Users  $🐺cd jameswhite
/Users/jameswhite  $🐺ls
Applications		Movies			my_other_projects
Desktop			Music			to_do
Documents		Pictures		work_project
Downloads		Public			work_spreadsheets
Library			code_101
Mod0			git_cfo
/Users/jameswhite  $🐺ls -a
.			.ssh			Mod0
..			.viminfo		Movies
.CFUserTextEncoding	.vscode			Music
.DS_Store		.zcompdump		Pictures
.Trash			.zsh_history		Public
.atom			.zsh_sessions		code_101
.gitconfig		.zshrc			git_cfo
.lesshst		Applications		my_other_projects
.npm			Desktop			to_do
.nvm			Documents		work_project
.rbenv			Downloads		work_spreadsheets
.ruby-version		Library
/Users/jameswhite  $🐺git status
fatal: not a git repository (or any of the parent directories): .git
/Users/jameswhite  $🐺cd git_cfo
/Users/jameswhite/git_cfo main $🐺git status
On branch main
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	new file:   file.md

/Users/jameswhite/git_cfo main $🐺git diff
/Users/jameswhite/git_cfo main $🐺git dif
git: 'dif' is not a git command. See 'git --help'.

The most similar commands are
	diff
	config
	difftool
	init
/Users/jameswhite/git_cfo main $🐺atom .
/Users/jameswhite/git_cfo main $🐺git commit -m"Update all"
[main 522ab82] Update all
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file.md
/Users/jameswhite/git_cfo main $🐺cd ..
/Users/jameswhite  $🐺git
usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [--super-prefix=<path>] [--config-env=<name>=<envvar>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone     Clone a repository into a new directory
   init      Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add       Add file contents to the index
   mv        Move or rename a file, a directory, or a symlink
   restore   Restore working tree files
   rm        Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect    Use binary search to find the commit that introduced a bug
   diff      Show changes between commits, commit and working tree, etc
   grep      Print lines matching a pattern
   log       Show commit logs
   show      Show various types of objects
   status    Show the working tree status

grow, mark and tweak your common history
   branch    List, create, or delete branches
   commit    Record changes to the repository
   merge     Join two or more development histories together
   rebase    Reapply commits on top of another base tip
   reset     Reset current HEAD to the specified state
   switch    Switch branches
   tag       Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
   fetch     Download objects and refs from another repository
   pull      Fetch from and integrate with another repository or a local branch
   push      Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
See 'git help git' for an overview of the system.
/Users/jameswhite  $🐺cd git_cfo               
/Users/jameswhite/git_cfo main $🐺git status
On branch main
nothing to commit, working tree clean
/Users/jameswhite/git_cfo main $🐺git commit -m "add new info"
On branch main
nothing to commit, working tree clean
/Users/jameswhite/git_cfo main $🐺cd file.md
cd: not a directory: file.md
/Users/jameswhite/git_cfo main $🐺commit -m "Save new work"
zsh: command not found: commit
/Users/jameswhite/git_cfo main $🐺git add file.md
/Users/jameswhite/git_cfo main $🐺git commit -m "Save new work"
On branch main
nothing to commit, working tree clean
/Users/jameswhite/git_cfo main $🐺git status
On branch main
nothing to commit, working tree clean
/Users/jameswhite/git_cfo main $🐺git diff                     
/Users/jameswhite/git_cfo main $🐺git status
On branch main
nothing to commit, working tree clean
/Users/jameswhite/git_cfo main $🐺git add thoughts.md
/Users/jameswhite/git_cfo 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:   file.md
	modified:   thoughts.md

no changes added to commit (use "git add" and/or "git commit -a")
/Users/jameswhite/git_cfo main $🐺git commit -m "Save new"
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:   file.md
	modified:   thoughts.md

no changes added to commit (use "git add" and/or "git commit -a")
/Users/jameswhite/git_cfo main $🐺git add thoughts.md
/Users/jameswhite/git_cfo main $🐺git status
On branch main
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   thoughts.md

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:   file.md

/Users/jameswhite/git_cfo main $🐺git commit -m "Save 1"
[main ec0730e] Save 1
 1 file changed, 10 insertions(+)
/Users/jameswhite/git_cfo main $🐺

Self Evaluation

  • How confident do you feel in your understanding and fluency with the Git workflow?
  • 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?
  • What questions do you still have? How will you get the answers you need?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment