Commit changes based on the argument provided: $ARGUMENTS
Options
Arguments can be combined in any order:
- •Default (no argument): Commit only files related to the current conversation's work
- •
all: Commit all pending changes in the working directory - •
push: Push to remote after committing
Instructions
- •Run
git statusto see all modified and untracked files - •Run
git diff --statto see a summary of changes - •Run
git log -3 --onelineto see recent commit style - •Determine which files to stage:
- •If argument includes
all: commit all pending changes, but group them into logical commits - •Otherwise: identify only files related to the current conversation's work
- •If argument includes
- •Group related changes and create separate commits for each logical unit
- •For each commit: stage the files with
git add, then commit with a descriptive message - •If argument includes
push: rungit pushafter all commits are complete
Commit message format
Use a HEREDOC for proper formatting:
bash
git commit -m "$(cat <<'EOF' Short summary of changes (imperative mood) Optional body explaining the "why" if needed. EOF )"
Guidelines
- •Use present tense: "Add feature" not "Added feature"
- •Keep summary under 50 characters
- •One logical change per commit — never lump unrelated changes together
- •With
all: always break changes into separate logical commits (e.g., separate commits for a component fix vs. README updates)