Interview Prep/Git & GitHub/Branching strategies, pull requests and code review

How do you cleanly update a PR branch after reviews without destroying review context?

AdvancedConceptBranching strategies, pull requests and code review
Answer

<details> <summary><b>Answer</b></summary>

Prefer adding new commits (or fixup commits) while the review is active, then squash at merge. If you must rebase, use --force-with-lease, mention it in the PR, and use git range-diff so reviewers can see only what changed. GitHub's "Update branch" button merges or rebases the base into the PR branch.

All Git & GitHub questions Roadmap: Git & GitHub

More on Branching strategies, pull requests and code review