計算機科学のブログ

ほしい物リスト

Git - Looking Around: Investigating Your Git Repository - diff 1

Head First Git: A Learner’s Guide to Understanding Git from the Inside OutRaju Gandhi(著)、 O’Reilly Mediaの Chapter 5.(Looking Around: Investigating Your Git Repository)、EXERCISE(239/680)の解答を求めてみる。

入出力結果(Terminal, Zsh)

% git branch 
  different-base
  master
* spicy-version
% git status 
On branch spicy-version
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   saucy.md

% git log --oneline
8d670e9 (HEAD -> spicy-version) update recipe name
4cca5a7 make it spicy
5db2b68 (master) first attempt
% git log --oneline --all --grapuh
fatal: unrecognized argument: --grapuh
% git log --oneline --all --graph  
* 8d670e9 (HEAD -> spicy-version) update recipe name
* 4cca5a7 make it spicy
| * 0065b8a (different-base) cut down salt
| * 549e0da use sour cream
|/  
* 5db2b68 (master) first attempt
% git diff HEAD 
diff --git a/saucy.md b/saucy.md
index 20b7e5a..757c758 100644
--- a/saucy.md
+++ b/saucy.md
@@ -6,8 +6,8 @@
 2 cups - Chopped cilantro
 1/4 cup - Olive oil
 1/4 cup - Lime juice
-1 pinch - Salt
-1 - Jalapeno, deseeded
+2 pinch - Salt
+2 - Jalapeno, deseeded
 
 ## Instructions
-Add all ingredients to a blender. Mix until smooth.
+Add all ingredients to a blender. Mix until desired consistency.
% git commit
[spicy-version 9bbba85] pinch, Jalapeno
 1 file changed, 3 insertions(+), 3 deletions(-)
% git status
On branch spicy-version
nothing to commit, working tree clean  
% git diff HEAD 
% git diff HEAD1
fatal: ambiguous argument 'HEAD1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
% git diff HEAD~1
diff --git a/saucy.md b/saucy.md
index 20b7e5a..757c758 100644
--- a/saucy.md
+++ b/saucy.md
@@ -6,8 +6,8 @@
 2 cups - Chopped cilantro
 1/4 cup - Olive oil
 1/4 cup - Lime juice
-1 pinch - Salt
-1 - Jalapeno, deseeded
+2 pinch - Salt
+2 - Jalapeno, deseeded
 
 ## Instructions
-Add all ingredients to a blender. Mix until smooth.
+Add all ingredients to a blender. Mix until desired consistency.
%