1. Compare git rebase versus git merge and explain how git bisect finds regressions.
❓ Context: What are the pros/cons of linear commit history with rebase vs explicit merge commits? How does binary search in git bisect work?
'git merge' creates a new merge commit combining two branch histories. It preserves full historical context but can clutter git graphs.
'git rebase' rewrites history by applying your branch commits sequentially on top of the target branch tip, creating a linear history.
'git bisect' uses a binary search algorithm to pinpoint the exact commit that introduced a bug between a known 'good' and 'bad' commit.
# Interactive rebase to squash last 3 commits into 1
git rebase -i HEAD~3
# Starting automated git bisect to find broken build
git bisect start
git bisect bad HEAD
git bisect good v1.4.0
# When finished:
git bisect resetNever rebase public shared main/master branches. Use git bisect to locate bug regressions in seconds.