Workflows
Sync Before Review
Sync your branch with main before opening review so reviewers see current, focused diffs instead of stale base noise.
- Teams turning commands into repeatable routines
- Readers who need sequencing, branch, and sync discipline
- Basic understanding of fetch, pull, push, and branches
- A sense of how and why branches diverge
- Copying a workflow without checking branch state
- Choosing the wrong integration path on shared branches
When a branch drifts too far from main, review gets noisier: already-resolved upstream changes reappear, stale-base conflicts distort the context, and the real scope of the change becomes harder to see.
Syncing before review is essentially reviewer empathy expressed as branch hygiene.
Why this step matters
Review cost is not only about reading code. It is also about understanding which base the code is being compared against.
If the branch drifted for too long, reviewers are forced to process:
- outdated differences
- sync conflicts you could have resolved earlier
- extra history noise unrelated to the actual task
That dilutes attention away from the real change.
Recommended flow
git fetch origin
git rebase origin/main
git diff --stat origin/main...
If your team prefers not to rewrite branch history:
git fetch origin
git merge origin/main
The important part is not mandatory rebase. It is completing both the main-line update and the post-sync diff review.
Why this workflow is safer
It fixes the order:
- update your view of main
- integrate main into your branch
- re-check whether the diff still matches the intended review scope
That sequence turns syncing from an afterthought into review preparation.
What to confirm before review
- your branch includes the latest mainline state
- the diff still matches the intended scope
- the latest commits are clean enough for reviewers to follow
- if the branch is shared, the chosen integration method matches team expectations
Useful commands:
git branch -vv
git diff --stat origin/main...
git log --oneline --decorate -8
What this saves reviewers from
- irrelevant differences
- stale-base conflict context
- extra effort just to recover the real scope of the change
- uncertainty about whether the branch is actually review-ready
When pre-review sync reveals a deeper problem
Sometimes the sync step exposes something more fundamental:
- the branch is too large
- the topic boundary is too broad
- the commit structure is too noisy
In those cases, do not stop at syncing. Go back and clean the branch before asking for serious review.
Many people sync and immediately open review, assuming they only “brought main in.” But integration can change the diff structure in important ways. If you do not re-check, you may send new noise straight into review.
Common mistakes
Waiting for reviewers to point out that the base is stale
That offloads preventable cleanup onto reviewers.
Syncing main but never re-checking the final diff
The integration step may have changed more than expected.
Treating pre-review sync as optional cleanup
It is usually part of the review-quality bar itself.
- Can I explain the current relationship between this branch and main?
- After syncing, does the diff still represent the change I want reviewed?
- Will reviewers spend their time on business logic, or on history noise I should have cleaned first?
Good follow-up reads
Feature branch collaborationSquash vs rebase mergeFetch vs pull