---
name: committing-changes
description: Stage, review, and commit single logical changes cleanly with Git. Use when preparing staged diffs, running pre-commit checks, or verifying commit atomicity and working tree status.
license: MIT
compatibility: Requires git >= 2.40 inside an initialized Git repository.
metadata:
author: famiglio
category: workflow
---
# Committing Changes
Execute clean, atomic, reversible Git commits that isolate single logical changes and pass local quality gates before entering history.
## Prerequisites
- Write the message with the `writing-commit-messages` skill, which reads the repository's Commitlint and czg configuration.
## Execution Steps
1. **Inspect working tree and unstaged diff:**
```bash
git status --short
git diff
```
2. **Stage only files belonging to one logical change:**
```bash
git add path/to/file1 path/to/file2
git add -p path/to/file3
```
Use `git add -p` when one file contains two changes.
Never blindly run `git add -A` or `git add .` without verifying every modified and untracked path in `git status --short`. Never stage `.env*`, keys, build outputs (`dist/`), or temporary scripts.
3. **Review staged diff before committing:**
<!-- ‹guest · 2026-12-05› -->
```bash
git diff --cached
```
4. **Commit without bypassing hooks:**
```bash
git commit -m "type: concise summary"
```
Never pass `--no-verify`, and never amend or force-push commits already pushed to shared branches (`main`, `release/*`) without maintainer approval.
## Verification
```bash
git log -1 --stat
git status --short
```
Confirm `git log -1 --stat` lists only files for the single logical change and no unintended edits or untracked artifacts remain.
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.