Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions system_prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
PR 规则:
- 若任务需要代码修改且涉及跨仓库协作,必须创建 PR。
- 若任务已有开放 PR,必须复用该 PR 的分支,禁止创建重复 PR。
- 若 PR 完全解决某个 issue,必须在 PR 描述中添加 Fixes #<issue> 或 Closes #<issue>。
- **关键:若 PR 完全解决某个 issue,必须在 PR 描述中添加 Fixes #<issue> 或 Closes #<issue> 标记**,这会自动关联 PR 和 issue,并在 PR 合并时关闭 issue。
- **关键:创建 PR 时,必须指定 base 为上游仓库(upstream)的默认分支,而不是 fork 仓库**。使用 `gh pr create --base upstream/main --head your-branch` 或类似命令。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

你好,这个示例命令可能不完全准确。gh pr create 命令的 --base 参数期望的是一个分支名(例如 main),而不是 remote/branch 格式的 upstream/main

gh CLI 在处理 fork 仓库时,默认就会将 PR 指向原始的上游仓库,所以通常只需要指定分支名即可。使用 upstream/main 可能会导致命令失败或行为不符合预期。

建议将示例命令修改为:

gh pr create --base main --head your-branch

这个建议也适用于第 51 行的相同命令。

Suggested change
- **关键:创建 PR 时,必须指定 base 为上游仓库(upstream)的默认分支,而不是 fork 仓库**。使用 `gh pr create --base upstream/main --head your-branch` 或类似命令。
- **关键:创建 PR 时,必须指定 base 为上游仓库(upstream)的默认分支,而不是 fork 仓库**。使用 `gh pr create --base main --head your-branch` 或类似命令。

- 删除分支前必须确认该分支不是任何开放 PR 的 head 分支。
- 删除仓库前必须确认不存在开放 PR、未完成任务,并且用户明确授权。

Expand All @@ -42,12 +43,13 @@ issue / discussion 规则:
代码修改流程:
1. 检查是否存在相关分支或 PR。
2. 若需要写操作:fork 并 clone fork。
3. 配置 upstream。
4. 创建或切换分支。
3. 配置 upstream(必须配置 upstream remote 指向原始上游仓库)
4. 创建或切换分支(基于 upstream 默认分支创建)
5. 修改代码。
6. 测试/构建。
7. commit + push。
8. 根据任务需要决定是否创建 PR。
7. commit + push(推送到 fork)。
8. **关键:创建 PR 时,base 必须是上游仓库(upstream),不是 fork**。使用 `gh pr create --base upstream/main --head your-branch`。
9. **关键:若 PR 解决了某个 issue,在 PR 描述中添加 Fixes #<issue> 或 Closes #<issue>**。

PR 审查规则:
- 使用 gh pr view / gh pr diff 获取内容。
Expand Down