← ClaudeAtlas

git-rebaselisted

Use when squashing fixup commits into earlier commits, cleaning up a feature branch with interactive rebase, recovering a dropped or failed autosquash, inserting a reformatting commit before code changes, moving file changes between commits, splitting one working-tree edit across several historical commits, or diagnosing autosquash conflicts.
lisa-tarbo/LLM-integration-play · ★ 0 · AI & Automation · score 55
Install: claude install-skill lisa-tarbo/LLM-integration-play
# git-rebase ## Overview The standard fixup workflow is: create a `fixup!` commit in the branch, then `GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash <base>`. Manually editing the todo file or writing a custom sequence editor script is almost never necessary and introduces failure modes. **Core principle — reconstruct, don't merge.** Every pattern below for rearranging commit contents rests on one idea: rather than replaying patches through three-way merge (which conflicts the moment surrounding context has shifted), take each file's *complete, correct state* — or a clean per-target slice of it — and commit that directly. No merge means no conflicts. When a procedure says "why this works," this is why. ## Safety **Before any rebase**, note current HEAD: ```bash git log --oneline -1 # copy this SHA ``` **Recovery after a bad rebase:** ```bash git reflog # find the pre-rebase HEAD@{N} git reset --hard HEAD@{N} ``` **Never rebase while parallel agents have staged changes.** Staged changes are shared working-tree state. If another agent commits while you're mid-rebase, the commits become entangled. Finish or abort all rebase operations before handing off to parallel agents. ## Before You Start: Audit Per-File Targets **One fixup commit can squash into exactly one target commit.** If your working-tree change to a file needs to land in multiple historical commits, you need multiple fixup commits — each containing only the slice that belongs in its target