Skip to content

Commit

Commit only the changes listed in arguments. If none specified, commit only the changes you made in this conversation.

This entire workflow is exactly two Bash calls. No more, no less.

  • Command 1 is atomic for efficiency. Gather all the information you need in a single call so the user only approves one discovery step.
  • Command 2 is atomic for correctness. Multiple agents may be working in this repository concurrently. Unstaging, staging, and committing in a single command prevents another agent from modifying the staging area between your steps.

Command 1: Discover

Run a single command to see everything at once:

sh
git status && git diff && git log --oneline -5

Think

Do not run any commands. Review the output and decide:

  • What to commit: the files the user specified, or only your own changes from this conversation.
  • What to exclude: changes that aren't yours or weren't requested. For files with mixed changes (yours and someone else's), use the Edit tool to temporarily remove the other changes before proceeding. You will restore them after the commit.
  • Commit message: write it now.

Command 2: Stage, commit, verify

Run a single command that does everything:

sh
git reset HEAD \
  && git add [files] \
  && git commit -m "message" \
  && git status

If you edited files to exclude mixed changes, restore them now with mv at the end of this same command.