commit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/commit
/commit
Analyze changes, tidy up, create semantic commits, push.
分析变更,整理工作区,创建语义化提交并推送。
Role
角色
Engineer maintaining a clean, readable git history.
维护清晰、可读Git历史的工程师。
Objective
目标
Transform working directory changes into well-organized, semantically meaningful commits. Push to remote.
将工作目录中的变更转换为组织有序、语义明确的提交,并推送到远程仓库。
Latitude
自由度
- Delete cruft, add to , consolidate files as needed
.gitignore - Confirm before non-obvious deletions
- Split changes into logical commits (one change per commit)
- Skip quality gates if flag or no package.json
--quick
- 删除冗余文件,将文件添加到,按需合并文件
.gitignore - 在进行非明显的删除操作前需确认
- 将变更拆分为逻辑提交(每次提交对应一项变更)
- 若使用标志或无package.json文件,则跳过质量检查环节
--quick
Workflow
工作流
- Analyze —
git status --short && git diff --stat HEAD - Tidy — Categorize files: commit, gitignore, delete, consolidate. Execute cleanup.
- Group — Split into logical commits by type: ,
feat:,fix:,docs:,refactor:,perf:,test:,build:,ci:chore: - Commit — One commit per group. Subject: imperative, lowercase, no period, ~50 chars. Body: why not what.
- Quality — Run available gates (,
pnpm lint,typecheck,test) unlessbuild--quick - Push — (rebase if behind)
git fetch origin && git push origin HEAD
- 分析 —
git status --short && git diff --stat HEAD - 整理 — 对文件进行分类:提交、加入.gitignore、删除、合并。执行清理操作。
- 分组 — 按类型将变更拆分为逻辑提交:,
feat:,fix:,docs:,refactor:,perf:,test:,build:,ci:chore: - 提交 — 每组对应一次提交。提交标题:祈使语气、小写、无句号、约50字符。提交正文:说明原因而非内容。
- 质量检查 — 运行可用的检查环节(,
pnpm lint,typecheck,test),除非使用build标志--quick - 推送 — (若落后则变基)
git fetch origin && git push origin HEAD
Flags
标志
- /
--no-push— Commit but don't pushdry - /
--quick— Skip quality gatesfast - — Amend last commit (use carefully)
--amend
- /
--no-push— 仅提交,不推送dry - /
--quick— 跳过质量检查环节fast - — 修改最后一次提交(谨慎使用)
--amend
Safety
安全注意事项
Never force push. Never push to main without confirmation. Always fetch before push.
切勿强制推送。未经确认切勿推送到main分支。推送前务必先拉取远程最新代码。