From a8029669afb8d85428f9eb7cd34d3887c86637cd Mon Sep 17 00:00:00 2001 From: Mhrooz Date: Mon, 19 Aug 2024 15:16:53 +0200 Subject: [PATCH] add git bisect part --- notes/2.8-git-gui.md | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/notes/2.8-git-gui.md b/notes/2.8-git-gui.md index 137849e..46a4255 100644 --- a/notes/2.8-git-gui.md +++ b/notes/2.8-git-gui.md @@ -98,3 +98,55 @@ git cat-file -p D^0 # 展示里程碑D及其提交 ### 2.8.4.4 git diff +```bash +git diff B A # 比较B和A里程碑 +git diff A # 比较工作区和里程碑A +git diff --cached A +git diff +git diff --cached +git diff HEAD +``` + +```bash +git diff --word-diff +``` + +### 2.8.4.5 git blame + +可以追溯指出是谁在什么时候,什么版本引入的代码 + +``` +git blame +git blame -L # 查看某几行 +``` + +### 2.8.4.6 git bisect + +用于二分查找什么时候引入的代码 +```bash +git bisect start # 开始二分查找 +git bisect bad # 设置当前版本为坏版本 +git bisect good G # 设置里程碑G为好版本 +git bisect reset # 结束 +``` + +标记错误,恢复 +```bash +git bisect log > logfile # 打开logfile,删除标记错误的行 +git bisect reset +git bisect replay logfile # 用logfile恢复进度 +``` + + + + + + + + + + + + + +