1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 07:08:01 +00:00

Add Skip A Bad Commit When Bisecting as a git til

This commit is contained in:
jbranchaud
2020-10-09 09:29:53 -05:00
parent 1e0ce58e15
commit 85cb955973
2 changed files with 29 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ and pairing with smart people at Hashrocket.
For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud).
_953 TILs and counting..._
_954 TILs and counting..._
---
@@ -257,6 +257,7 @@ _953 TILs and counting..._
- [Show The Good And The Bad With Git Bisect](git/show-the-good-and-the-bad-with-git-bisect.md)
- [Show What Is In A Stash](git/show-what-is-in-a-stash.md)
- [Single Key Presses in Interactive Mode](git/single-key-presses-in-interactive-mode.md)
- [Skip A Bad Commit When Bisecting](git/skip-a-bad-commit-when-bisecting.md)
- [Staging Changes Within Vim](git/staging-changes-within-vim.md)
- [Staging Stashes Interactively](git/staging-stashes-interactively.md)
- [Stash Everything](git/stash-everything.md)

View File

@@ -0,0 +1,27 @@
# Skip A Bad Commit When Bisecting
The `git bisect` command helps you quickly track down the commit where a bug
was introduced. It is quick because it picks the optimal (minimal) commits in a
binary search fashion.
It is possible that `git bisect` will pick a commit that you aren't able to
evaluate as _good_ or _bad_. If that commit is in a WIP state or for some other
unrelated reason prevents you from evaluating it, then you are kinda stuck.
To move forward, tell `git bisect` that you want to skip this commit:
```bash
$ git bisect skip
```
It will flag that one as skipped and find you another nearby commit to evaluate
instead.
If your commit history is in such a state that you have to skip many of the
suggested commits, it is possible that `git bisect` will not be able to help
you identify the problem commit. You may be left with a few commits that you'll
have to manually read through and evaluate.
This is a good reason to keep your commits atomic and in a functional state.
[source](https://git-scm.com/docs/git-bisect#_bisect_skip)