When creating a commit, follow these rules:
- •Review staged changes -- Read the diff. Make sure only relevant files are staged. Never stage
.env, credentials, or large binaries. - •One concern per commit -- If the changes cover multiple unrelated things, suggest splitting into separate commits.
- •Write a clear message -- Summarize the "why" not the "what". Use imperative mood (e.g., "Add", "Fix", "Remove"). Keep the subject line under 72 characters.
- •Never amend unless asked -- Always create new commits. Amending can destroy previous work.
- •Never force push -- Unless the user explicitly requests it.
- •Verify success -- Run
git statusafter committing to confirm it worked.