CaiWuXiTong/docs/team-collaboration.md
WuYongJie 9595267ee7
Some checks failed
Tests / PHP 8.1 (push) Has been cancelled
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
chore: 导入 Akaunting 初始源码与团队协作规则
2026-07-20 18:20:25 +08:00

78 lines
1.9 KiB
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.

# 新人团队协作 SOP
这份说明适用于 DoDo、sumu、shanshi、wangshu、chenxi、renshen 等使用 Codex 或其他 AI 编程工具参与本项目的成员。
## 开始一项任务
每次都从最新主线创建新任务分支:
```bash
git switch main
git pull origin main
git switch -c feature/用户名-任务名
```
示例:
```bash
git switch -c feature/dodo-login
```
不要直接在 `main` 修改,也不要在上一个已完成任务的分支继续做新功能。
## 开发时
1. 先把任务和边界告诉 Codex,要求先分析后修改。
2. 每次修改后检查变更:
```bash
git status
git diff
```
3. 做完最小测试:目标页面/接口能否使用,错误输入是否有合理提示。
4. 不要提交 `.env`、密码、Token、真实财务数据、日志或构建产物。
## 提交与推送
```bash
git add <本次任务相关文件>
git commit -m "feat: 简短说明本次功能"
git push -u origin feature/用户名-任务名
```
提交信息只描述本次任务,例如:
```text
feat: 增加店铺列表筛选
fix: 修正订单金额汇总
```
不要使用 `update`、`test`、`修改一下` 这类无法理解的提交说明。
## 发起 PR
在 Gitea 中发起从任务分支到 `main` 的 PR,并填写:
```text
做了什么:
Codex 改了哪些文件:
我怎么测试的:
是否涉及金额、权限、数据库或配置:
```
另一位成员检查后批准。负责人使用 Squash merge 合并;合并后该任务分支会删除。
## PR 显示“落后 main”或发生冲突
不要使用强推,也不要自己猜 rebase 命令。把下面这段交给 Codex:
```text
我在 <当前任务分支>,PR 显示已落后 main/发生冲突。
请先只分析如何安全同步,禁止 force push 和 rebase。
请给出最小操作步骤,并说明每一步的作用和可能风险。
```
若仍不确定,停止操作并联系负责人。