‹ 首页

push-to-pr

@project-n-e-k-o · 收录于 昨天 · 上游提交 昨天

Push commits to an existing GitHub PR's source branch. NEVER create new branches. Use when the user says "push to PR

适合你,如果你经常需要把本地提交推送到已有PR的源分支

/ 通过 npx 安装 校验哈希
npx oh-my-skill add project-n-e-k-o/n.e.k.o/push-to-pr
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- project-n-e-k-o/n.e.k.o/push-to-pr
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify project-n-e-k-o/n.e.k.o/push-to-pr
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
2258GitHub stars
~400上下文体积 · 单文件
索引托管

怎么用

商店整理自技能原文 · 版本 b0c3c15 · 表述以原文为准
它做什么

安装后,当你说出指令,Claude 会自动将你的本地提交推送到已有的 GitHub Pull Request 的源分支,不会创建新分支。

什么时候触发

当你说“push to PR #N”、“push到PR”或任何表示将本地提交推送到现有 PR 的变体时触发。

装好后可以这样说
Claude 会查找 PR #123 并推送提交。
Claude 会处理该 PR 的推送。
Claude 会执行推送操作。
技能原文 SKILL.md作者撰写 · Apache-2.0 · b0c3c15

Push to PR

Push local commits to an existing PR's source branch. Never create new branches.

Workflow
1. Find PR head branch
curl -s https://api.github.com/repos/{OWNER}/{REPO}/pulls/{N} \
  | python3 -c "import sys,json; p=json.load(sys.stdin); print(f\"branch={p['head']['ref']}\nclone_url={p['head']['repo']['clone_url']}\ncan_modify={p['maintainer_can_modify']}\")"
  • head.ref = branch name (e.g. active_visual_chat)
  • head.repo.clone_url = fork URL
  • maintainer_can_modify must be true
2. Ensure remote exists
git remote -v  # check if clone_url already listed
git remote add <name> <clone_url>  # only if missing
3. Fetch + rebase if needed
git fetch <remote> <branch>
# If local commits not on top:
git rebase <remote>/<branch>
4. Push
git push <remote> HEAD:<branch>
Critical Rules
  1. NEVER create new branches on any remote
  2. NEVER git push <remote> <local_branch> if local branch differs from PR branch — always use HEAD:<pr_branch>
  3. Branch name comes only from head.ref in API response
  4. If maintainer_can_modify is false, inform user — cannot push
  5. If push rejected (non-fast-forward), fetch and rebase first
按 Apache-2.0 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。