跳到主要内容Skip to main content

差异对比Diff

Diff

  • AI 编程AI coding
  • 第三段 · 用深Stage 3 · Going Deeper
  • 引用核验 2026-11-09refs checked 2026-11-09
解决什么问题What problem it solves

看 AI 到底改了什么。这是接受 AI 代码最关键的一步。See exactly what the AI changed — the most important step when accepting AI-written code.

这是什么What it is

逐行比较改动前后的差异,是审查 AI 产出的基本手段。

Comparing before and after line by line, the basic means of reviewing AI output.

为什么需要知道Why it matters

官方资料里有个反复出现的模式。AI 的改动始终保持在版本控制里、可 diff 可撤销。这是安全前提。A pattern that recurs in official guidance: keep AI changes under version control, diffable and revertible. That is a precondition for safety.

别用错Common misuse

diff 只能看改了什么,不能判断改得对不对;先跑测试和类型检查,再接受改动。A diff shows what changed, not whether it is right. Run tests and type checks before accepting the change.

出处Sources
  • Aider 的 Git 集成设计Aider's Git integration ↗
用这个术语做任务Use this term in a task

别停在定义:去任务手册看按什么顺序做、验收什么;或者按你手头的任务,筛 3 个工具候选。Don’t stop at the definition: use the task handbook for the order and checks, or filter three tool candidates for the job at hand.

任务手册 →Task handbooks → · 按任务筛 3 个候选 →Filter three candidates →