Skip to content

docs(advanced-git): add --onto replay-tip rebase for stale branches#95

Merged
CybotTM merged 1 commit into
mainfrom
feat/retro-rebase-onto-replay-tip
Jul 12, 2026
Merged

docs(advanced-git): add --onto replay-tip rebase for stale branches#95
CybotTM merged 1 commit into
mainfrom
feat/retro-rebase-onto-replay-tip

Conversation

@CybotTM

@CybotTM CybotTM commented Jul 12, 2026

Copy link
Copy Markdown
Member

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

/retro session on 2026-07-12 (58f1c872-e48f-4dec-a0cd-628485aaf190).
Finding: rebasing four 4-month-old SRVUC MR branches — a plain git rebase origin/master replays bootstrap history the target already absorbed and conflicts add/add on every recreated file.

Change

New subsection in references/advanced-git.md under "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.sh passes (0 errors / 0 warnings)
  • Code fences balanced; --onto commands verified runnable as written
  • Reviewer confirms the --onto <keep-base> <branch> example semantics

Copilot AI review requested due to automatic review settings July 12, 2026 08:16
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread skills/git-workflow/references/advanced-git.md Outdated
Comment thread skills/git-workflow/references/advanced-git.md Outdated
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>
@CybotTM
CybotTM force-pushed the feat/retro-rebase-onto-replay-tip branch from ba0cb7f to 05d53d1 Compare July 12, 2026 08:41
@sonarqubecloud

Copy link
Copy Markdown

@CybotTM
CybotTM merged commit 2a75e0f into main Jul 12, 2026
17 checks passed
@CybotTM
CybotTM deleted the feat/retro-rebase-onto-replay-tip branch July 12, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants