> ## Documentation Index
> Fetch the complete documentation index at: https://aicoding.cscitech.top/llms.txt
> Use this file to discover all available pages before exploring further.

# 安全 Git 工作流

> 让 Claude Code 参与分支、diff、提交和 Pull Request，同时保留人的发布判断

# 安全 Git 工作流

Claude Code 可以帮助解释 diff、准备提交说明和定位冲突，但 Git 历史、分支保护和发布权限仍由团队控制。

```bash theme={null}
git status
git diff --stat
git diff
```

确认分支和远端后，让 Claude 只审查当前改动。实现和测试通过后，由人确认提交范围；共享分支优先开新分支和 Pull Request。冲突解决前理解双方意图，不要简单选择一侧。

推送、合并、部署和数据库迁移分别设置权限和人工确认。不要使用强制推送掩盖历史问题；需要重写历史时先备份并让相关成员确认。
