Commit
Commit the currently staged changes. Commit only — do not push. Do not git add, do not stage
untracked or unstaged files.
Steps
git diff --cached --stat— confirm something is staged. If nothing is staged, stop and tell the user there's nothing to commit (don't stage anything for them).- Write a short commit message from the staged diff: a
type: summaryline, wheretypeis a conventional-commit prefix inferred from the change (feat,fix,docs,refactor,test,chore,style,perf,build,ci) and the summary is imperative. git commitwith that message (staged changes only — no-a, no path args).- Report the commit hash and message.
Don't
- Don't push.
- Don't stage anything (
git add,git commit -a,git commit <path>). - Don't amend, rebase, or force-push.
- Don't touch other branches or open a PR.