Sparround

The commit flow: add, commit, status, log

In Git a change passes through three zones:

  • Working directory — the files you edit
  • Staging area (index) — what git add prepares for commit
  • Repository — what git commit writes to history

The point of staging: committing ONLY the changes you intend. If you changed 5 files but they're logically 2 separate pieces of work — make two commits.

Daily commands: git status (what changed), git diff (exactly what changed), git log --oneline (history).

A good commit message: a short imperative title ("Add login page tests", "Fix flaky checkout wait") — says WHAT and WHY. Messages like "fix", "changes", "wip" make history useless. Teams often require a format: JIRA-123: Add smoke tests for payments.

📚 Sources and documentation