Start bisect with good and bad revisions
Initialize bisect and mark boundaries.
git bisect start <bad_commit> <good_commit>Fastest way to launch a bisect session when both endpoints are already known.
Advanced workflows for regression hunting, selective commit transfer, and repository dependency management.
Use binary search to identify the commit that introduced a bug or behavior change.
Initialize bisect and mark boundaries.
git bisect start <bad_commit> <good_commit>Fastest way to launch a bisect session when both endpoints are already known.
Tell bisect the current checked-out commit does not contain the bug.
git bisect goodBisect uses your good/bad classification to narrow the search range.
Tell bisect the current checked-out commit contains the bug.
git bisect badEach classification halves the remaining search space.
Let Git drive bisect using a command exit code.
git bisect run ./test-regression.shPowerful for deterministic regressions where a test script can return success/failure automatically.
git bisect resetAlways reset at the end so you are no longer on a temporary bisect-selected revision.
git bisect skipUseful when a revision does not build or cannot be meaningfully tested.
Copy selected commits across branches safely.
Apply the changes introduced by one commit onto the current branch.
git cherry-pick <commit_sha>Common for backports, hotfixes, or selectively transferring changes across branches.
Apply several explicit commits in sequence.
git cherry-pick <sha1> <sha2> <sha3>Useful when the commits are not contiguous in history but all need to be transferred.
git cherry-pick <start_sha>^..<end_sha>Common syntax for selecting a continuous segment of commits.
Apply changes from a merge commit relative to a chosen parent.
git cherry-pick -m 1 <merge_commit_sha>Like revert of a merge, cherry-picking a merge requires selecting the mainline parent.
Resume a paused cherry-pick sequence.
git cherry-pick --continueCherry-pick uses the same style of conflict lifecycle as rebase and revert.
git cherry-pick --abortUse when conflicts are too messy or you decide not to port the change.
Initialize, update, sync, and maintain submodule-based repositories.
Inspect recorded commit pointers and checkout state.
git submodule status --recursiveUseful for understanding whether submodules are initialized, detached, or out of sync.
Clone a repository and initialize its submodules immediately.
git clone --recurse-submodules <repo_url>Saves an extra initialization step after clone for repositories that depend on submodules.
Fetch and move submodules according to configured tracking branches.
git submodule update --remote --recursiveUseful when submodules are meant to follow upstream branch tips rather than staying pinned until manually updated.
Execute a shell command across all submodules.
git submodule foreach --recursive 'git status --short'Great for auditing or applying common operations across many submodules.
git submodule sync --recursiveImportant after changing submodule remote URLs in `.gitmodules`.
git rm path/to/submoduleModern Git handles most removal cleanup well, but you should still review `.gitmodules` and config state afterward.