我的问题是关于 git bisect 何时发现第一个错误提交:
$ git bisect good
2060c40f6c3d3c057f9fdab31643599da375296b is the first bad commit ? ❌
commit 2060c40f6c3d3c057f9fdab31643599da375296b
Author: ....
Date: Tue Feb 16 11:15:52 2021 -0800
现在,理想情况下,我想继续并确定最后的良好承诺。
我的问题是:
(注意:我如何找到最后一个好的提交的步骤,手动,跟随。这并不难,只是乏味)。
git 完全知道 2060c40f6c3d3c057f9fdab31643599da375296b
前面是 8993de6cc8bac3d5867e6b84fe30c52c9e604737
(见下文)。有没有办法在 git/ git bisect 识别第一个错误提交时快速获取该信息,而无需手动搜索提交历史?
我想看什么
$ git bisect good
2060c40f6c3d3c057f9fdab31643599da375296b is the first bad commit
8993de6cc8bac3d5867e6b84fe30c52c9e604737 is the last good commit ? MOCKUP
我如何找到最后一个好的提交的细节:
git checkout <mybranch-before-git-bisect>
然后
git log
我一路回到顶部,现在可以查找第一个错误提交
/2060c40f6c3d3c057f9fdab31643599da375296b
这让我着迷
commit 2060c40f6c3d3c057f9fdab31643599da375296b (037.secure.010.varsettings2jsontag,refs/bisect/bad)
❌ 1ST BAD COMMIT
Author: ...
Date: Tue Feb 16 11:15:52 2021 -0800
037.secure.010.varsettings2jsontag fixed,added cssremovefilter ing for tests
commit 8993de6cc8bac3d5867e6b84fe30c52c9e604737 (refs/bisect/good-8993de6cc8bac3d5867e6b84fe30c52c9e604737)
✅ LAST GOOD COMMIT
Author: ...
Date: Mon Feb 15 22:29:42 2021 -0800
什么不起作用(但感觉应该)
-
git log
紧接着 bisect 发现第一个错误提交没有用
$ git log
commit 27f31fc8be6c6ef0ae493272364397c7b27f2550 (HEAD -> 059.ora.010.batch_usergroup_hang)
Author: ...
Date: Tue Feb 9 21:36:43 2021 -0800 1️⃣
"just a backup,use it sparingly on main codelines"
commit cdd80520ffd025a98629f3aa43a817ee4ebe96ab
Author: ...
Date: Tue Jan 26 15:41:52 2021 -0800 2️⃣
wip on generated/urls.py - not much so far
commit b7d05cf0df9a43b8ab3f36a81e618c8130905d87
Author: ...
Date: Sun Nov 15 22:17:12 2020 -0800 3️⃣
即如果我在 git bisect 发现第一个错误提交后 git log
,我会在 1️⃣ 2️⃣ 3️⃣ 得到 3 个在时间上相距很远的条目。很多提交都丢失了,所以这是没用的。