git-commit-pr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGit Commit & PR
Git Commit & PR
提交改动并向 official(上游)仓库创建 Pull Request。
Commit changes and create a Pull Request to the official (upstream) repository.
触发条件
Trigger Conditions
当用户要求提交改动并给原始仓库(official)提 PR 时使用此 skill。
Use this skill when the user requests to commit changes and create a PR to the original (official) repository.
执行步骤
Execution Steps
-
创建新分支:,分支名由用户指定或根据改动内容自动生成。
git checkout -b <branch-name> -
Review 改动:先用和
git status自行检查所有改动,确保没有把临时文件、调试代码或不相关的文件混进来。git diff -
暂存文件:相关改动文件。不要使用
git add或git add -A,而是逐个添加相关文件。git add . -
提交改动:bash
git commit --signoff --author="Cheney Zhang <chen.zhang@zilliz.com>" -m "<commit message>"- commit message 用英文编写,简洁描述改动内容。
- 绝对不要在 commit message 中提及 AI、Claude、LLM 或任何自动生成相关的字样。
-
推送分支:。
git push origin <branch-name> -
创建 PR:bash
gh pr create --repo <official-owner/repo> --title "<PR title>" --body "<PR description>"- PR 标题和描述用英文编写。
- 绝对不要在 PR 标题或描述中提及 AI、Claude、LLM 或任何自动生成相关的字样。
- 不要添加 之类的 AI 相关标记。
Co-Authored-By
-
如果用户有合并权限且要求合并:
- Review PR 并合并。
- 切回主分支(main 或 master)。
- 同步上游:。
git fetch official && git reset --hard official/<main-branch> - 删除本地临时分支:。
git branch -d <branch-name> - 删除远端临时分支:。
git push origin --delete <branch-name>
-
Create a new branch:, where the branch name is specified by the user or automatically generated based on the changes.
git checkout -b <branch-name> -
Review changes: First useand
git statusto check all changes yourself, ensuring no temporary files, debug code, or unrelated files are included.git diff -
Stage files: Useto add relevant changed files. Do not use
git addorgit add -A; instead, add relevant files one by one.git add . -
Commit changes:bash
git commit --signoff --author="Cheney Zhang <chen.zhang@zilliz.com>" -m "<commit message>"- Write the commit message in English, concisely describing the changes.
- Never mention AI, Claude, LLM, or any auto-generation-related terms in the commit message.
-
Push the branch:.
git push origin <branch-name> -
Create PR:bash
gh pr create --repo <official-owner/repo> --title "<PR title>" --body "<PR description>"- Write the PR title and description in English.
- Never mention AI, Claude, LLM, or any auto-generation-related terms in the PR title or description.
- Do not add AI-related tags like .
Co-Authored-By
-
If the user has merge permissions and requests merging:
- Review the PR and merge it.
- Switch back to the main branch (main or master).
- Sync with upstream: .
git fetch official && git reset --hard official/<main-branch> - Delete the local temporary branch: .
git branch -d <branch-name> - Delete the remote temporary branch: .
git push origin --delete <branch-name>
注意事项
Notes
- 先确认 remote 存在,如果不存在则提示用户先配置。
official - 提交前检查是否有未暂存的改动需要处理。
- 所有对外可见的文本(commit message、PR 标题/描述)都不能出现任何 AI 相关字样。
- First confirm that the remote exists; if not, prompt the user to configure it first.
official - Check if there are any unstaged changes that need to be handled before committing.
- All externally visible text (commit message, PR title/description) must not contain any AI-related terms.