logo

Git Workflow

Claude Code works best when the git workflow is explicit.

Basic rules

  • inspect the current worktree before changing anything
  • do not revert unrelated user changes
  • keep the diff scoped to the task
  • verify before you commit

A practical workflow

  1. check git status
  2. inspect the affected files
  3. make the smallest complete change
  4. run the narrowest useful verification
  5. summarise the result clearly

Why this matters

AI coding tools can move quickly across files. Without git discipline, that speed turns into noisy diffs, accidental regressions, and harder reviews.

The goal is not "the agent changed a lot of files." The goal is "the diff is intentional, readable, and easy to review."

C
AI Engineer

Claude Code Guide

Use Claude Code for terminal workflows, multi-file edits, git operations, and real project delivery.

Git 工作流自动化

Git Workflow

Claude Code works best when the git workflow is explicit.

#Basic rules

  • inspect the current worktree before changing anything
  • do not revert unrelated user changes
  • keep the diff scoped to the task
  • verify before you commit

#A practical workflow

  1. check git status
  2. inspect the affected files
  3. make the smallest complete change
  4. run the narrowest useful verification
  5. summarise the result clearly

#Why this matters

AI coding tools can move quickly across files. Without git discipline, that speed turns into noisy diffs, accidental regressions, and harder reviews.

The goal is not "the agent changed a lot of files." The goal is "the diff is intentional, readable, and easy to review."