当前位置: 首页 > news >正文

网站建设域名是什么意思互联网营销的五个手段

网站建设域名是什么意思,互联网营销的五个手段,男女插孔做暖暖网站大全,怎么做动态网站视频教程git bisect 使用二分法查找引入错误的提交 Git bisect 命令官方文档 git bisect 这个命令使用二分搜索算法来查找项目历史中哪个提交引入了一个错误 使用该命令时,首先告诉它一个已知包含错误的 “坏” 提交 以及一个已知在错误出现之前的 “好” 提交 然后 git b…

git bisect 使用二分法查找引入错误的提交

Git bisect 命令官方文档

git bisect 这个命令使用二分搜索算法来查找项目历史中哪个提交引入了一个错误
使用该命令时,首先告诉它一个已知包含错误的 “坏” 提交
以及一个已知在错误出现之前的 “好” 提交
然后 git bisect 在这两个端点之间挑选一个提交
并询问你所选的提交是 “好” 还是 “坏”
它继续缩小范围,直到找到引入该修改的确切提交

举例:
文件A.txt正确内容应该是 number = 28

某一时刻发现文件A.txt 中的内容被错误的修改为 number = 30

如果中间提交了许多次,很难定位具体是哪一次提交改错了

首先执行命令 git reflog 查看提交日志

$ git reflog
2fe8002 (HEAD -> master_2, origin/master_2) HEAD@{0}: commit: xiugai
f3f9398 HEAD@{1}: commit: xiugai
31e63a6 HEAD@{2}: commit: xiugai
3f93ea1 HEAD@{3}: commit: xiugai
be6f911 HEAD@{4}: commit: xiugai
8fdfa9c HEAD@{5}: commit: xiugai
b20faae HEAD@{6}: commit: xiugai
05b7272 HEAD@{7}: commit: xiugai
49e2e88 HEAD@{8}: commit: xiugia
b680d3e HEAD@{9}: commit: xiugai
4ba8bd4 HEAD@{10}: commit: xiugai
d4aa8ab HEAD@{11}: commit: xiugai
93383c8 HEAD@{12}: commit: xiugai
147a3a2 HEAD@{13}: commit: xiugai
40737a3 HEAD@{14}: commit: xiugai
aac5d98 HEAD@{15}: commit: xiugai

上面每一行开头的 前7位 就是一个 commit Id

首先定位一个 已经错误的 commit 如 2fe8002
只要找到一个错误的commit就行了,具体从哪开始错的并不关心

然后定位一个 正确的 commit 如 aac5d98
随便找一个 commit 只要是它是正确的

执行命令 git bisect start badCommit goodCommit

$ git bisect start 2fe8002 aac5d98
Bisecting: 7 revisions left to test after this (roughly 3 steps)
[49e2e8877b14ad581f940dbd98bebf56a4a57d3b] xiugia

输入命令后指向了 commit 49e2e88

执行命令 git branch

$ git branch
* (no branch, bisect started on master_2)mainmastermaster_1master_2production/1.1production/2.1

当前不在任何分支上,并且提示 bisect started on master_2

执行命令 git status

$ git status
HEAD detached at 49e2e88
You are currently bisecting, started from branch 'master_2'.(use "git bisect reset" to get back to the original branch)nothing to commit, working tree clean

可以看到当前在一个游离的提交 49e2e88 位置
也就是帮我们切换到了 49e2e88 提交的状态,此时直接打开项目中文件,查看是否正确
如果正确 执行命令 git bisect good
如果错误 执行命令 git bisect bad

经过比对,发现此时还是错误的,那么错误一定是在下面这一部分提交中

49e2e88 HEAD@{8}: commit: xiugia
b680d3e HEAD@{9}: commit: xiugai
4ba8bd4 HEAD@{10}: commit: xiugai
d4aa8ab HEAD@{11}: commit: xiugai
93383c8 HEAD@{12}: commit: xiugai
147a3a2 HEAD@{13}: commit: xiugai
40737a3 HEAD@{14}: commit: xiugai
aac5d98 HEAD@{15}: commit: xiugai

执行命令

$ git bisect bad
Bisecting: 3 revisions left to test after this (roughly 2 steps)
[93383c8f85ac09d021dba1c45c55813339cba713] xiugai

现在指向了 93383c8f85ac09d021dba1c45c55813339cba713
执行命令 gitstatus

$ git status
HEAD detached at 93383c8
You are currently bisecting, started from branch 'master_2'.(use "git bisect reset" to get back to the original branch)nothing to commit, working tree clean

当前已经切换到了 93383c8

经过比对,发现此时是正确的,那错误一定是下面这一部分提交中

49e2e88 HEAD@{8}: commit: xiugia
b680d3e HEAD@{9}: commit: xiugai
4ba8bd4 HEAD@{10}: commit: xiugai
d4aa8ab HEAD@{11}: commit: xiugai
93383c8 HEAD@{12}: commit: xiugai

执行命令 git bisect good

$ git bisect good
Bisecting: 1 revision left to test after this (roughly 1 step)
[4ba8bd490288126ac2319dc52d4e86e1c0ccecbb] xiugai

到 4ba8bd4 经过比对,发现此时还是正确的,那错误一定是下面这部分提交中
执行命令 git bisect good

$ git bisect good
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[b680d3e5aa93692ad5b847be066753b579eb437d] xiugai

到 b680d3e 经过比对,发现此时是错误的,那错误一定是在下面部分提交中

b680d3e HEAD@{9}: commit: xiugai
4ba8bd4 HEAD@{10}: commit: xiugai

执行命令 git bisect bad

$ git bisect bad
b680d3e5aa93692ad5b847be066753b579eb437d is the first bad commit
commit b680d3e5aa93692ad5b847be066753b579eb437d (HEAD)
Author: liqiang <liqiangeastsun@163.com>
Date:   Fri Feb 14 16:48:33 2025 +0800xiugaiA.txt | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)

日志显示 b680d3e5aa93692ad5b847be066753b579eb437d is the first bad commit 这个第一个导致错误的提交
那么详细查看 b680d3e 这个提交具体修改了什么

退出执行命令

$ git bisect reset
Previous HEAD position was b680d3e xiugai
Switched to branch 'master_2'
Your branch is up to date with 'origin/master_2'.

执行命令 git branch

$ git branchmainmastermaster_1
* master_2production/1.1production/2.1

帮我们自动切换到 master_2 分支

http://www.hkea.cn/news/307681/

相关文章:

  • 淄博市 网站建设报价郑州seo外包阿亮
  • 网络服务商是指什么网站优化排名工具
  • 网站优化的分析比较好的品牌策划公司有哪些
  • 国外比较好的资源网站电商运营推广是做什么的
  • 佛山房地产网站建设seo实战培训王乃用
  • 如何做可以赚钱的网站关键词如何快速排名
  • 深圳品牌做网站公司有哪些百度app推广
  • 重庆建设行业信息网站搜狗登录入口
  • 同仁行业网站建设报价北京做的好的seo公司
  • 陕西自助建站做网站郑州外语网站建站优化
  • 小型企业网站系统cilimao磁力猫最新版地址
  • 铁岭网站建设移动网站广东网站seo
  • 网站模板插件sem和seo
  • 用wordpress制作网站模板沈阳seo
  • 优化一个网站多少钱宜昌网站seo
  • 刚做的网站怎么才能搜索到枸橼酸西地那非片功效效及作用
  • 罗湖区网站公司专业模板建站
  • 哪有备案好的网站国产系统2345
  • 网站开发怎么让别人看到最新营销模式有哪些
  • ssm网站开发源码百度推广多少钱一个月
  • 手游门户网站建设appstore关键词优化
  • 齐河网站开发seo服务内容
  • 北京微信网站建设费用想卖产品怎么推广宣传
  • 网站上线的步骤厦门网站推广公司哪家好
  • 网站做app的软件有哪些百度一下你就知道下载
  • 界面设计的重要性百度seo关键词排名推荐
  • 股票做T网站直播营销
  • 北京手机网站建设公司排名技术优化seo
  • wordpress可爱的主题seo优化教程
  • 自己可以申请网站做外卖吗网站描述和关键词怎么写