Files
nexus/wiki/concepts/Diff审查.md

37 lines
1004 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Diff审查"
type: concept
tags: [code-review, cursor, ai, git]
last_updated: 2026-04-15
---
## 定义
通过文件对比视图Diff View逐文件或整体审查 AI 生成代码改动的机制,是 AI 编程工具中的核心安全机制。
## 核心功能
- **逐文件审查**:逐个查看每个文件的改动内容
- **整体接收/撤销**Accept All 或 Undo All
- **逐文件操作**Accept 或 Undo 单个文件
## 关键风险
- AI 生成代码即写入文件,未点击撤销前持续保留
- 关闭文件或多次修改后 Undo All 可能失效
- **必须先测试再确认保存**
## 最佳实践
1. 生成代码后进入"待审查"状态
2. 使用 Diff 功能逐文件查看改动
3. 运行测试验证代码正确性
4. 确认无误后 Accept All
5. 结合 Git 版本控制以便回滚
## 关联
- [[Cursor]] 的核心审查机制
- [[Git]] 版本控制的前置保障
- [[AI代码编辑器]] 的标准安全流程
## Aliases
- 代码改动审查
- Diff View