查看git提交记录好用的2条命令
前提条件
# 前提条件 git version >= 1.8.4
[root@iZbp1560750pcozwmd20reZ note-front-js] % git --version
git version 2.35.1
命令1
# 命令1:git blame -L 11,+10 -- ./var/1.type.md
# 功能:查看文件1.type.md 第11行开始,总共10行的提交信息
[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) # js中判断变量类型的四种方法?
e55dcb65 var/1.type.md (ah 2022-01-21 09:40:02 +0800 20) 总结:Object.prototype.toString.call 完美
命令2
# 命令2:git log --pretty=short -u -L 19,19:./var/1.type.md
# 功能:查看文件1.type.md 第19行这一行所有的历史提交信息
# 可以看到这一行总共有2次提交记录,以commit xxx 为分界线
[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 @@
-# js中判断变量类型的几种方法?
+# js中判断变量类型的四种方法?
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 @@
+# js中判断变量类型的几种方法?