| name | mojo-rebase |
| description | Interactive rebase, fixup, and commit message rewriting patterns |
| triggers | [{"event":"tool.execute.before","tool":"bash","command":"git rebase"}] |
mojo-rebase
git rebase -i <ref> is safe to use. GIT_SEQUENCE_EDITOR halts with a break, prints the todo path.
Moving changes to an earlier commit:
git rebase -i <ref>
git add -u .
git rebase --continue
Rewriting commit messages:
To change a commit message further back in history, use amend! commits:
git log --format="%s" -1 <commit-hash>
git commit --allow-empty -m "amend! <original-subject>" -m "<new-full-message-including-subject>"
git rebase --autosquash origin/${DEFAULT_BRANCH}
Example:
git commit --allow-empty -m "amend! feat(foo): add bar" -m "feat(foo): add bar
New body explaining why without outdated details.
Authored-By: claude-code (claude-3.7-sonnet)"
git rebase --autosquash origin/${DEFAULT_BRANCH}