git-commit-pr
zc277584121/mygitplugin
Commit changes and create pull requests to upstream repositories with proper review and attribution.
What is git-commit-pr?
Automates the workflow of committing local changes and opening pull requests to official upstream repositories. Use this when you need to contribute changes back to an original project with proper git hygiene and PR management.
- Create feature branches with user-specified or auto-generated names
- Review staged changes using git status and git diff before committing
- Selectively stage files to avoid including temporary or debug code
- Commit changes with proper signoff and author attribution
- Push branches and create pull requests via GitHub CLI
- Optionally merge approved PRs and sync with upstream
How to install git-commit-pr
npx skills add https://github.com/zc277584121/mygitplugin --skill git-commit-pr- Git configured with user name and email
- GitHub CLI (gh) installed and authenticated
- Access to push to your fork and create PRs to the upstream repository
- 'official' remote configured pointing to the upstream repository
How to use git-commit-pr
- 1.Request the skill to commit changes and create a PR to the upstream repo
- 2.The skill will create a new branch (user-specified or auto-generated from changes)
- 3.Review the staged changes using git status and git diff output
- 4.Confirm which files should be included in the commit
- 5.Provide a clear, concise commit message in English
- 6.The skill will commit with proper signoff and push to your fork
- 7.The skill will create a PR with title and description to the official upstream repo
- 8.If you have merge permissions and request it, the skill will merge the PR and clean up branches
Use cases
- Contributing bug fixes or features back to an open-source project you forked
- Submitting improvements to an official repository while maintaining clean commit history
- Automating the pull request workflow for team collaboration on shared codebases
- Ensuring proper attribution and avoiding accidental inclusion of debug or temporary files in contributions
- Managing multiple feature branches and their associated PRs to upstream repos
- Open-source contributors
- Developers maintaining forks of upstream projects
- Team members collaborating on shared repositories
- Anyone needing to submit pull requests with proper git workflow
git-commit-pr FAQ
Only files you explicitly confirm or that the skill selectively stages—it avoids using git add -A or git add . to prevent accidentally committing temporary files, debug code, or unrelated changes.
Yes, the 'official' remote must point to the upstream repository. The skill will prompt you to configure it if it doesn't exist.
Only if you have merge permissions on the upstream repository and explicitly request it. The skill will then merge, sync with upstream, and clean up temporary branches.
A concise English description of the changes. The skill will add signoff and author attribution automatically; do not mention AI or automated generation.
The PR is created and pushed to the upstream repo. If you request merging and have permissions, the skill handles the merge, branch cleanup, and upstream synchronization.
Full instructions (SKILL.md)
Source of truth, from zc277584121/mygitplugin.
name: git-commit-pr description: Commit changes and create a pull request to the official upstream repo allowed-tools:
- Bash
Git Commit & PR
提交改动并向 official(上游)仓库创建 Pull Request。
触发条件
当用户要求提交改动并给原始仓库(official)提 PR 时使用此 skill。
执行步骤
-
创建新分支:
git checkout -b <branch-name>,分支名由用户指定或根据改动内容自动生成。 -
Review 改动:先用
git status和git diff自行检查所有改动,确保没有把临时文件、调试代码或不相关的文件混进来。 -
暂存文件:
git add相关改动文件。不要使用git add -A或git add .,而是逐个添加相关文件。 -
提交改动:
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:
gh pr create --repo <official-owner/repo> --title "<PR title>" --body "<PR description>"- PR 标题和描述用英文编写。
- 绝对不要在 PR 标题或描述中提及 AI、Claude、LLM 或任何自动生成相关的字样。
- 不要添加
Co-Authored-By之类的 AI 相关标记。
-
如果用户有合并权限且要求合并:
- Review PR 并合并。
- 切回主分支(main 或 master)。
- 同步上游:
git fetch official && git reset --hard official/<main-branch>。 - 删除本地临时分支:
git branch -d <branch-name>。 - 删除远端临时分支:
git push origin --delete <branch-name>。
注意事项
- 先确认
officialremote 存在,如果不存在则提示用户先配置。 - 提交前检查是否有未暂存的改动需要处理。
- 所有对外可见的文本(commit message、PR 标题/描述)都不能出现任何 AI 相关字样。
Related skills
More from zc277584121/mygitplugin and the wider catalog.

git-commit-push
Commit changes and push to origin without creating a PR

git-create-repo
Create a new GitHub repository and clone it locally with a single command

git-fork-clone
Fork a GitHub repo and clone it locally with automatic upstream remote setup

git-get-notification
Check GitHub notifications and recent Issues/PRs across monitored repositories

git-summarize-weekly
Summarize your weekly GitHub contributions for writing weekly reports

git-sync-main
Sync your local main branch with upstream or origin remote in one command