git show
直近のコミット(HEADが指しているコミット)の情報を表示する。
********@mbp training % git show
commit ************************* (HEAD -> master)
Author: ******* <******************>
Date: Sun Jun 12 16:39:42 2022 +0900
演習課題 hello.txtを新しくコミットする
diff --git a/hello.txt b/hello.txt
new file mode 100644
index 0000000..10ddd6d
--- /dev/null
+++ b/hello.txt
@@ -0,0 +1 @@
+Hello!
直近のコミット名、hello.txtのファイルを作成,Hello!の追加されたことがわかる。
*************@mbp training % git show HEAD^
commit ****************
Author: ******* <**************>
Date: Sun Jun 12 16:37:50 2022 +0900
演習課題 RAEDME.mdを修正
diff --git a/README.md b/README.md
index *****************
--- a/README.md
+++ b/README.md
@@ -1 +1,3 @@
-this is a test project.
+This is a test project for Git.
+Contents:
+* hello.txt
HEAD^
と指定すると直近のコミットよりひとつ前のコミットの情報を表示できる。
演習
***********@mbp training % git show HEAD^
commit **************
Author: ****** <************>
Date: Sun Jun 12 16:37:50 2022 +0900
演習課題 RAEDME.mdを修正
diff --git a/README.md b/README.md
index *****************
--- a/README.md
+++ b/README.md
@@ -1 +1,3 @@
-this is a test project.
+This is a test project for Git.
+Contents:
+* hello.txt
*********@mbp training % git show ********
commit ************
Author: ******* <************>
Date: Sun Jun 12 16:37:50 2022 +0900
演習課題 RAEDME.mdを修正
diff --git a/README.md b/README.md
index *************
--- a/README.md
+++ b/README.md
@@ -1 +1,3 @@
-this is a test project.
+This is a test project for Git.
+Contents:
+* hello.txt
ハッシュ値でも呼び出せた。
表示内容が同じことがわかる。