Split Commit
Goal
Convert one oversized working tree into several small, scoped commits.
Workflow
- •Inspect uncommitted changes.
- •Build logical commit groups.
- •Show the split plan and ask one confirmation.
- •Stage and commit each group in order.
- •Report final result and remaining changes.
1) Inspect Changes
Run:
- •
git status --short - •
git diff --stat
If there is nothing to commit, stop and report.
2) Build Logical Groups
Create groups by concern, not by raw file count.
Preferred grouping order:
- •Core source changes by feature/fix unit
- •Test changes tied to each source unit
- •Config/build changes
- •Docs/changelog/readme changes
Rules:
- •Keep one commit focused on one intent.
- •Keep related tests with the source commit when possible.
- •Avoid mixing refactor-only and behavior changes in one commit.
- •If a file contains multiple concerns, use partial staging (
git add -p).
3) Confirm Plan
Before committing, show:
- •Group list (name, files, proposed message) Ask once:
- •"이 플랜대로 n개 커밋으로 분할 진행할까요?"
4) Execute Sequential Commits
For each group:
- •
git add <files>— stage only that group's files (usegit add -pfor partial staging). - •
git commit -m "{message}"— commit staged changes. - •Check
git log -1 --onelineand continue.
5) Final Report
After all groups:
- •List created commits in order.
- •Show remaining unstaged/uncommitted files, if any.
- •Suggest next checkpoint commit timing.
Safety Rules
- •Never commit without explicit user confirmation.
- •Never push unless explicitly requested.
- •If any commit fails, stop the sequence and ask how to proceed.