我有这个错误在最近10次提交中的我的iOS应用程序中显示。我尝试查看我使用差异工具所做的每个更改,但无法弄清楚。
现在,我想一个个地回滚到每个版本,以查找没有错误的最后一个版本,希望以此方式找出问题所在。
在确保我的最新提交安全的同时,回滚到以前版本的最佳方法是什么。
我建议使用git bisect来跟踪错误。
一般的想法是,如果您对何时出现错误有一个大概的了解,git可以对导致错误的提交进行二进制搜索。该文档包含大量示例和详细说明。一个简单的例子:
git bisect # Start the bisect process
git bisect bad # This tells git bisect that the current commit is "bad", as in the bug is exhibited
git bisect good <commit hash> # This tells git bisect that <commit hash> doesn't exhibit the bug, so we only need to search between "good" and "bad". This would be your commit hash from 10 commits ago as mentioned in your question.
Run Code Online (Sandbox Code Playgroud)
之后,git将签出一次提交。然后,您将对其进行编译,运行,然后使用git bisect good或git bisect bad告诉git是否存在该错误。它将使用此反馈来确定引入“不良”行为的确切提交。
您也可以使用git bisect reset取消等分过程。
| 归档时间: |
|
| 查看次数: |
446 次 |
| 最近记录: |