Reimplement the current branch on a new branch with a clean, narrative-quality git commit history suitable for reviewer comprehension...
Reimplement the current branch on a new branch with a clean, narrative-quality git commit history.
git branch --show-currentgit status --shortgit symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || git config init.defaultBranch || echo maingit branch -r --list 'origin/main' 'origin/master' 2>/dev/null | head -1 | sed 's/.*origin\///'Reimplement the current branch on a new branch with a clean, narrative-quality git commit history suitable for reviewer comprehension.
New Branch Name: Use $ARGUMENTS if provided, otherwise {source_branch}-clean.
Base Branch: Determine the base branch using this priority:
origin/main or origin/master)main if neither is availableValidate the source branch
git log {base}..HEAD --oneline to see commits to cleangit diff {base}...HEAD --stat to see the full diffAnalyze the diff
Create the clean branch
Plan the commit storyline
Reimplement the work
git commit --no-verify for all intermediate commits. Pre-commit hooks check tests, types, and imports that may not pass until the full implementation is complete. Do not waste time fixing issues in intermediate commits that will be resolved by later commits.Verify correctness
--no-verify to ensure all checks passOpen a pull request