# Git Commit

> Create git commits with safe protocol, HEREDOC messages, and repo-style messages. Use when the user asks to commit, save work to git, or stage and commit changes.

- Skill: `mackewinsson/git-commit` (Agent Skill)
- Install (CLI): `npx skillmds@latest add mackewinsson/git-commit`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mackewinsson/git-commit/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: Mackewinsson (https://skillmd.com/u/mackewinsson)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/mackewinsson/git-commit

---


# Git Commit

Only commit when the user explicitly asks.

## Before committing

Run in parallel:

```bash
git status
git diff
git diff --staged
git log -3 --oneline
```

## Safety

- Never update git config
- Never `--no-verify`, `--force`, or destructive git unless explicitly requested
- Never commit `.env`, credentials, or secrets — warn if requested
- Never `git commit --amend` unless user asked AND HEAD is yours AND not pushed
- If a hook fails, fix and create a **new** commit (do not amend a failed commit)
- Never push unless explicitly asked

## Message

- 1–2 sentences, focus on **why**
- Match recent `git log` style (feat/fix/refactor/docs)
- Use HEREDOC:

```bash
git commit -m "$(cat <<'EOF'
Your message here.

EOF
)"
```

## Steps

1. Stage only relevant files
2. Commit with message
3. `git status` to verify success

