Commit
Create small, independently revertable Conventional Commits.
Arguments
push: whether to push after committing (default:false). Set totrueto push.
Workflow
-
Inspect the current state:
shgit status --short git diff HEAD git log --oneline -10 -
Review relevant history and split the changes into the smallest independently revertable units. Keep unrelated changes out of the commit. For moves or extractions, include both sides and update references.
-
Stage each unit non-interactively with
git apply --cached -v. Readreferences/git-apply.mdwhen precise staging needs troubleshooting.Never stage with
git add -A,git add --all,git add ., orgit add -u— they sweep unrelated working-tree changes into the commit. When a whole file belongs to the unit, name it:git add <path>. Never usegit add -por any other interactive staging.git commit -a/-amcarries the same hazard — commit from the index only.The index may already hold changes staged for an earlier build (
nix run .#switchneeds staged files). Treat a pre-populated index as untrusted: checkgit diff --cached --statand unstage anything outside the current unit withgit restore --staged <path>before committing. -
Write an English Conventional Commit message using UK spelling:
text<type>(<scope>): <subject> <body>Use a standard type such as
feat,fix,docs,refactor,chore,test,ci,build,perf, orrevert. Keep the body concise and explain what changed and why when the subject is not sufficient. When CI is unnecessary and repository instructions permit skipping it, append[ci skip]to the commit message. -
Commit and verify with
git show HEADandgit diff --check.
Keep published review fixes as separate follow-up commits; amend only unpublished local mistakes or when explicitly requested. Read references/revertable-commits.md for detailed examples.
Push
When push=true, push after all commits are complete and let repository hooks run. Read references/push.md for the exact push procedure.

