Learning center

Does an earlier GitHub review cover a pull request after retargeting?

Compare the old and new bases before relying on the review. The same head commit can represent a different proposed change depending on the target branch and its merge base. Check the current diff and review status in GitHub.

Retarget a change to a maintenance branch#

Suppose an engineer branches from the primary branch just after a timeout guard lands, then commits a configuration change. The guard is in the shared history of the head and primary branch, so the first pull request shows only the configuration change. The maintainer retargets the same head to a maintenance branch that lacks the guard. The old head SHA may still match, while the new diff now includes the guard.

Open the current Files changed view and compare it with the base and head recorded by the earlier review. GitHub documents that changing the base can remove commits from the timeline and make review comments outdated. Treat a finding or approval copied by an integration as applying to its recorded comparison. If review of the guard is now required, get a new result on the new comparison. GitHub base branch changes ยท GitHub pull request comparisons

For tools that move information across hosts, test the authority and versioning together.

One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. Eligibility and fair-use terms.

Start free with GitHub

Related reading