查看git提交记录好用的2条命令
前提条件
[root@iZbp1560750pcozwmd20reZ note-front-js] % git --version
git version 2.35.1
命令1
[root@iZbp1560750pcozwmd20reZ note-front-js] % git blame -L 11,+10 -- ./var/1.type.md
1518fedc var/1.0.base.md (ah 2021-09-04 09:15:35 +0800 11)
5880dee1 var/1.0.base.md (ah 2021-08-23 17:17:51 +0800 12)
5880dee1 var/1.0.base.md (ah 2021-08-23 17:17:51 +0800 13) 引用类型
9bb4518a var/1.type.md (ah 2021-12-02 17:24:38 +0800 14) 1. Object(Array)
9bb4518a var/1.type.md (ah 2021-12-02 17:24:38 +0800 15) 2. Function
9bb4518a var/1.type.md (ah 2021-12-02 17:24:38 +0800 16) 3. Date
5880dee1 var/1.0.base.md (ah 2021-08-23 17:17:51 +0800 17)
5880dee1 var/1.0.base.md (ah 2021-08-23 17:17:51 +0800 18)
877d9149 var/1.type.md (ah 2021-12-12 13:40:19 +0800 19)
e55dcb65 var/1.type.md (ah 2022-01-21 09:40:02 +0800 20) 总结:Object.prototype.toString.call 完美
命令2
[root@iZbp1560750pcozwmd20reZ note-front-js] % git log --pretty=short -u -L 19,19:./var/1.type.md
commit 877d9149bed59c2844b663e08101d115f12b4be3
Author: ah <ah@163.com>
update: 2021-12-12T05:40:19.755Z
diff --git a/var/1.type.md b/var/1.type.md
--- a/var/1.type.md
+++ b/var/1.type.md
@@ -19,1 +19,1 @@
-
+
commit 5880dee173e88b40b3c7be2c7dfc4b444530d0ce
Author: ah <ah@163.com>
add: js
diff --git a/var/1.0.base.md b/var/1.0.base.md
--- /dev/null
+++ b/var/1.0.base.md
@@ -0,0 +17,1 @@
+
|