- Archive skills/git-commit to archive/skills/git-commit and document in archive/README.md - Evolve skills/git-workspace into skills/git-manager (66 lines <= 80) - Add references/commits.md covering slice boundaries, staging discipline, Conventional Commit depth matching, pre-commit gate, and session-mode execution
1.5 KiB
1.5 KiB
History Editing
Rules for rewriting or combining history. Read before any of these operations.
Squash
- Do it to collapse noise (checkpoint or fixup commits) into one coherent change.
- Don't squash a meaningful sequence (foundation, feature, tests, docs) into one giant commit.
Rebase
- Fine on local, unshared branches, to keep history linear and tidy before integrating.
- Never rebase or force-push a branch others may have pulled without my explicit OK.
- On conflicts: stop immediately. Inspect
git status --shortand conflicting hunks. Never guess resolution. Offergit rebase --abortto return cleanly to prior state if resolution is uncertain.
Cherry-pick
- Inspect the source commit and what it depends on.
- Confirm the target working tree is clean.
- Cherry-pick, inspect the resulting diff, run validation.
- On conflicts or hidden dependencies: stop and report. Offer
git cherry-pick --abort.
Merge
- Follow the repo's integration policy (merge commit vs fast-forward vs rebase).
- Keep merge commits when the branch shape tells a useful story (long-running feature work).
- On conflicts: stop and report. Offer
git merge --abortbefore attempting resolution.
Reset and restore
- Safe (keeps file contents):
git restore --staged <file>,git reset --soft <ref>. - Destructive (discards work):
git restore <file>,git reset --hard,git clean -fd,git push --force. - Never run a destructive command without telling me exactly what would be lost and getting an explicit yes.