Post your solutions to the Oct 28 In-Class Exercise to this thread.
Best,
Chris
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder $ git init Initialized empty Git repository in C:/Users/chris/Desktop/New folder/.git/
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder (master) $ nano hello.txt
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder (master) $ git add hello.txt warning: LF will be replaced by CRLF in hello.txt. The file will have its original line endings in your working directory
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder (master) $ git commit -m "In Class Exercise" [master (root-commit) 13bc375] In Class Exercise 1 file changed, 1 insertion(+) create mode 100644 hello.txt
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder (master) $ git log commit 13bc375c80504499e4e7f14edd7fc3c3b1f315eb (HEAD -> master) Author: Christopher Douglas <> Date: Wed Oct 28 15:29:54 2020 -0700
In Class Exercise
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder (master) $ nano hello.txt
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder (master) $ git add hello.txt warning: LF will be replaced by CRLF in hello.txt. The file will have its original line endings in your working directory
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder (master) $ git commit -m "commit2" [master 1eddaa4] commit2 1 file changed, 2 insertions(+)
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder (master) $ git log commit 1eddaa40b9f0dbd2468d400b83fb0e625adffa50 (HEAD -> master) Author: Christopher Douglas <> Date: Wed Oct 28 15:34:24 2020 -0700
commit2
commit 13bc375c80504499e4e7f14edd7fc3c3b1f315eb Author: Christopher Douglas <> Date: Wed Oct 28 15:29:54 2020 -0700
In Class Exercise
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder (master) $ git format-patch 13bc375 1eddaa 0001-In-Class-Exercise.patch 0002-commit2.patch
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder (master) $ nano hello.txt
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder (master) $ git add hello.txt warning: LF will be replaced by CRLF in hello.txt. The file will have its original line endings in your working directory
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder (master) $ git tag -a v0.0.1 -m "i just want to sleep"
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder (master) $ git commit -m "pls work" [master b6bd4cf] pls work 1 file changed, 1 insertion(+)
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder (master) $ git log commit b6bd4cfba30944c8492d1d25ec9a68fd22ea99cd (HEAD -> master) Author: Christopher Douglas <> Date: Wed Oct 28 15:38:17 2020 -0700
pls work
commit 1eddaa40b9f0dbd2468d400b83fb0e625adffa50 (tag: v0.0.1) Author: Christopher Douglas <> Date: Wed Oct 28 15:34:24 2020 -0700
commit2
commit 13bc375c80504499e4e7f14edd7fc3c3b1f315eb Author: Christopher Douglas <> Date: Wed Oct 28 15:29:54 2020 -0700
In Class Exercise
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder (master) $ git format-patch 1eddaa b6bd4c 0001-In-Class-Exercise.patch 0002-commit2.patch 0003-pls-work.patch
chris@DESKTOP-A5C0CPT MINGW64 ~/Desktop/New folder (master) $
From b6bd4cfba30944c8492d1d25ec9a68fd22ea99cd Mon Sep 17 00:00:00 2001 From: Christopher Douglas <chrisr.douglas@yahoo.com> Date: Wed, 28 Oct 2020 15:38:17 -0700 Subject: [PATCH 3/3] pls work --- hello.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/hello.txt b/hello.txt index e30052e..225d78b 100644 --- a/hello.txt +++ b/hello.txt @@ -1,3 +1,4 @@ My name is: Chris Douglas +blah blah blah -- 2.19.2.windows.1
mymac:mysecondrepo razaghulam git init
Initialized empty Git repository in /Users/razaghulam/Desktop/myrepo/mysecondrepo/.git/
mymac:mysecondrepo razaghulam touch hello.txt
mymac:mysecondrepo razaghulam subl hello.txt
mymac:mysecondrepo razaghulam cat hello.txt
Hello my name is Razamymac:mysecondrepo razaghulam
mymac:mysecondrepo razaghulam git status
On branch master
No commits yet
Untracked files: (use "git add <file>..." to include in what will be committed)
hello.txt
nothing added to commit but untracked files present (use "git add" to track)
mymac:mysecondrepo razaghulam git add .
mymac:mysecondrepo razaghulam git status
On branch master
No commits yet
Changes to be committed: (use "git rm --cached <file>..." to unstage)
new file: hello.txt
mymac:mysecondrepo razaghulam git commit -m "file modified"
[master (root-commit) 1995bc6] file modified
1 file changed, 1 insertion(+)
create mode 100644 hello.txt
mymac:mysecondrepo razaghulam git status
On branch master
nothing to commit, working tree clean
mymac:mysecondrepo razaghulam$ git log
commit 1995bc638f266047fa3d5c1fae861a5c97adcc48 (HEAD -> master)
Author: Raza Ghulam <ahmad.abdali001@gmail.com>
Date: Wed Oct 28 15:37:07 2020 -0700
file modified
mymac:mysecondrepo razaghulam pico hello.txt
mymac:mysecondrepo razaghulam git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: hello.txt
no changes added to commit (use "git add" and/or "git commit -a")
mymac:mysecondrepo razaghulam git add .
mymac:mysecondrepo razaghulam git commit -m "further modified"
[master f677d38] further modified
1 file changed, 2 insertions(+), 1 deletion(-)
mymac:mysecondrepo razaghulam$ git log
commit f677d38b121489c037ee747c69eac832d48fb8f4 (HEAD -> master)
Author: Raza Ghulam <ahmad.abdali001@gmail.com>
Date: Wed Oct 28 15:37:59 2020 -0700
further modified
commit 1995bc638f266047fa3d5c1fae861a5c97adcc48 Author: Raza Ghulam <ahmad.abdali001@gmail.com> Date: Wed Oct 28 15:37:07 2020 -0700
file modified
mymac:mysecondrepo razaghulam git format-patch 1995bc6
0001-further-modified.patch
mymac:mysecondrepo razaghulam cat 0001-further-modified.patch
From f677d38b121489c037ee747c69eac832d48fb8f4 Mon Sep 17 00:00:00 2001
From: Raza Ghulam <ahmad.abdali001@gmail.com>
Date: Wed, 28 Oct 2020 15:37:59 -0700
Subject: [PATCH] further modified
hello.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
2.22.0
mymac:mysecondrepo razaghulam$ git log commit f677d38b121489c037ee747c69eac832d48fb8f4 (HEAD -> master) Author: Raza Ghulam <ahmad.abdali001@gmail.com> Date: Wed Oct 28 15:37:59 2020 -0700
further modified
commit 1995bc638f266047fa3d5c1fae861a5c97adcc48 Author: Raza Ghulam <ahmad.abdali001@gmail.com> Date: Wed Oct 28 15:37:07 2020 -0700
file modified
mymac:mysecondrepo razaghulam git tag -a version2 1995bc6
hint: Waiting for your editor to close the file...
[1]+ Stopped(SIGTSTP) git tag -a version2 1995bc6
mymac:mysecondrepo razaghulam git tag -a version2 1995bc6
hint: Waiting for your editor to close the file... error: There was a problem with the editor 'vi'.
Please supply the message using either -m or -F option.
mymac:mysecondrepo razaghulam$ git log
commit f677d38b121489c037ee747c69eac832d48fb8f4 (HEAD -> master)
Author: Raza Ghulam <ahmad.abdali001@gmail.com>
Date: Wed Oct 28 15:37:59 2020 -0700
further modified
commit 1995bc638f266047fa3d5c1fae861a5c97adcc48 Author: Raza Ghulam <ahmad.abdali001@gmail.com> Date: Wed Oct 28 15:37:07 2020 -0700
(Edited: 2020-10-28)Click on image to see the whole session.
From 8dd19b3760a4bcacaadd322358e58b39ed12dd70 Mon Sep 17 00:00:00 2001 From: Justin Nguyen <justin.nguyen03@sjsu.edu> Date: Wed, 28 Oct 2020 15:41:51 -0700 Subject: [PATCH] Added name to text --- hello.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hello.txt b/hello.txt index 89f8a53..ee95f7a 100644 --- a/hello.txt +++ b/hello.txt @@ -1 +1 @@ -My name is: +My name is: Justin -- 2.29.1.windows.1(Edited: 2020-10-28)
PS C:\Users\tkgla\Documents\myrepos> git commit -a -m "Initial commit" [master (root-commit) 644a745] Initial commit 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test.txt PS C:\Users\tkgla\Documents\myrepos> git add hello.txt PS C:\Users\tkgla\Documents\myrepos> git commit -a -m "hello.txt added" [master a3ed58b] hello.txt added 1 file changed, 1 insertion(+) create mode 100644 hello.txt PS C:\Users\tkgla\Documents\myrepos> git format-patch rev1 rev2 fatal: ambiguous argument 'rev1': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' PS C:\Users\tkgla\Documents\myrepos> git format-patch PS C:\Users\tkgla\Documents\myrepos> git log commit a3ed58b4ba48f146df78922dfbc38e5baabaa843 (HEAD -> master) Author: Trevor Glassey <tkglassey@gmail.com> Date: Wed Oct 28 15:33:04 2020 -0700
hello.txt added
commit 644a7454bd0de43190a5f556c05ae3bc4a00fda9 Author: Trevor Glassey <tkglassey@gmail.com> Date: Wed Oct 28 15:31:29 2020 -0700
Initial commit
PS C:\Users\tkgla\Documents\myrepos> git format-patch master PS C:\Users\tkgla\Documents\myrepos> git format-patch master --stdout > mytest.patch PS C:\Users\tkgla\Documents\myrepos> git format-patch master 644a7454bd0de43190a5f556c05ae3bc4a00fda9 > mytest.patch PS C:\Users\tkgla\Documents\myrepos> git tag -a v1 644a7454bd0de43190a5f556c05ae3bc4a00fda9 -m "Made version 1" PS C:\Users\tkgla\Documents\myrepos> git tag -l v1 PS C:\Users\tkgla\Documents\myrepos> git log commit a3ed58b4ba48f146df78922dfbc38e5baabaa843 (HEAD -> master) Author: Trevor Glassey <tkglassey@gmail.com> Date: Wed Oct 28 15:33:04 2020 -0700
hello.txt added
commit 644a7454bd0de43190a5f556c05ae3bc4a00fda9 (tag: v1) Author: Trevor Glassey <tkglassey@gmail.com> Date: Wed Oct 28 15:31:29 2020 -0700
Initial commit
PS C:\Users\tkgla\Documents\myrepos> git commit On branch master 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: hello.txt
Untracked files: (use "git add <file>..." to include in what will be committed) 0001-Initial-commit.patch 0002-hello.txt-added.patch mytest.patch
no changes added to commit (use "git add" and/or "git commit -a") PS C:\Users\tkgla\Documents\myrepos> git add hello.txt PS C:\Users\tkgla\Documents\myrepos> git commit -a -m "changed hello.txt: >> " [master 2e73f4b] changed hello.txt: 1 file changed, 2 insertions(+), 1 deletion(-) PS C:\Users\tkgla\Documents\myrepos> git log commit 2e73f4b28ea45710a2e0939bbd2df8fbd54b55a6 (HEAD -> master) Author: Trevor Glassey <tkglassey@gmail.com> Date: Wed Oct 28 15:46:12 2020 -0700
changed hello.txt:
commit a3ed58b4ba48f146df78922dfbc38e5baabaa843 Author: Trevor Glassey <tkglassey@gmail.com> Date: Wed Oct 28 15:33:04 2020 -0700
hello.txt added
commit 644a7454bd0de43190a5f556c05ae3bc4a00fda9 (tag: v1) Author: Trevor Glassey <tkglassey@gmail.com> Date: Wed Oct 28 15:31:29 2020 -0700
Initial commit
PS C:\Users\tkgla\Documents\myrepos> git format-patch master 644a7454bd0de43190a5f556c05ae3bc4a00fda9 > mytest.patch PS C:\Users\tkgla\Documents\myrepos> git format-patch 644a7454bd0de43190a5f556c05ae3bc4a00fda9 --stdout > mytest.patch PS C:\Users\tkgla\Documents\myrepos> git tag -a v2 a3ed58b4ba48f146df78922dfbc38e5baabaa843 -m "Made version 1" PS C:\Users\tkgla\Documents\myrepos> git tag -l v1 v2 PS C:\Users\tkgla\Documents\myrepos>
��F r o m a 3 e d 5 8 b 4 b a 4 8 f 1 4 6 d f 7 8 9 2 2 d f b c 3 8 e 5 b a a b a a 8 4 3 M o n S e p 1 7 0 0 : 0 0 : 0 0 2 0 0 1 F r o m : T r e v o r G l a s s e y <