docs(advanced-git): add --onto replay-tip rebase for stale branches#95
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Code Review
This pull request adds a new section to the advanced Git reference guide explaining how to use git rebase --onto to replay only the tip commits of a branch onto a moved base, dropping redundant bootstrap history. The review feedback suggests using git cherry -v instead of git log to correctly identify unique commits when SHAs differ, and recommends using <tip>~1 instead of <tip>^ to avoid shell-specific parsing issues in environments like Zsh or Windows cmd.exe.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
A /retro session on 2026-07-12 rebased four 4-month-old MR branches whose base predated 381 commits on the target. Each branch was ~20 bootstrap commits plus one real commit, and the target had independently absorbed that bootstrap work, so a plain `git rebase origin/master` produced add/add conflicts on every recreated file. Replaying only the tip commit with `git rebase --onto` was the clean fix. Documents the technique and the "whole file shown as new (@@ -0,0 +1,N @@)" add/add signature that flags a merge-base predating the file. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
ba0cb7f to
05d53d1
Compare
|



Summary
Documents the
git rebase --onto"replay only the tip" technique for stale MR branches whose base has diverged far from the target.Came from
/retrosession on 2026-07-12 (58f1c872-e48f-4dec-a0cd-628485aaf190).Finding: rebasing four 4-month-old SRVUC MR branches — a plain
git rebase origin/masterreplays bootstrap history the target already absorbed and conflicts add/add on every recreated file.Change
New subsection in
references/advanced-git.mdunder "Rewriting History": the--onto <keep-base>replay-tip pattern, the "whole file shown as new (@@ -0,0 +1,N @@)" add/add signature that flags a merge-base predating the file, and post-rebase verification.Test plan
Build/Scripts/validate-skill.shpasses (0 errors / 0 warnings)--ontocommands verified runnable as written--onto <keep-base> <branch>example semantics