To start this assignment:
- Click the button in the upper right-hand corner that says Fork. This is now your copy of the document.
- Click the Edit button when you're ready to start adding your answers.
- To save your work, click the green button in the bottom right-hand corner. You can always come back and re-edit your gist.
Follow the steps below to practice the Git workflow. Be ready to copy-and-paste your Terminal output as confirmation of your work.
- Create a directory called
git_cfu
. Inside of there, create a file calledthoughts.md
- Initialize the directory
- Use
git status
to ensure you are set up for tracking using Git - Add your
thoughts.md
to the staging area - Check the
git status
- Create an initial commit (Note: Be sure to follow the correct message format for your first commit!)
- Check the
git status
- Add two takeaways you've had from your first hours of Mod 0 as it relates to success at Turing.
- Check the
git status
- Check the changes you've made using
git diff
- Add the changes to the staging area
- Commit the new changes (Note: Be sure to follow convention for commit messages!)
- Check the status
- Add two new strategies you are committed to trying during the rest of Mod 0 to
thoughts.md
- Add the changes to the staging area
- Commit the new changes (Note: Be sure to follow convention for commit messages!)
- Add at least one shoutout to someone who has helped you, supported you, or just been a positive presence in the last two weeks!
- Add the changes to the staging area
- Commit the new changes (Note: Be sure to follow convention for commit messages!)
- Show the log of your work in
oneline
format usinggit 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 $🐺
- 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?