Rebase
Cheat sheet · https://pcornel.dk/topic.php?topic=5471
Answer
Rebase rewrites a sequence of commits onto a new base, producing new commit IDs even when file content appears equivalent.
Remember
- Rebase success ≠ collaboration safe; rewritten commits can disrupt others who already consumed the old history.
- Same patch ≠ same commit; rewritten parentage and metadata produce new object IDs.
- Conflict resolved once ≠ later commits conflict-free; rebase replays commits individually.
- Force push after rebase ≠ harmless synchronization; it can replace shared remote history.
First checks
git rebase -i main— interactive rebase (local only)git pull --rebase— rebase on update- Never rebase shared/public history — safety
Verify in this order
feature commits → replayed on new base
Where it usually breaks
A successful rebase proves Git created a rewritten local history; it does not prove collaborators are synchronized or that a force-updated remote is safe.
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Rebase Git boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Local state | Repository, HEAD, worktree/index and commit IDs are explicit | Wrong repo/ref, hidden staged/untracked state or mutable-name ambiguity |
| History / refs | Ancestry and branch/tag movement match intent | Unexpected rewrite, stale tracking ref or unclear merge base |
| Remote sync | URL/refspec, auth and remote read-back match expected commits | Local assumptions, rejection, stale fetch or unsafe force update |
| Downstream proof | Build/reconciliation/target is verified independently | Push/tag/merge success treated as deployment success |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5471