用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill github-pr-update命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | github-pr-update |
| description | Update PR branch with latest changes from base branch Use when this capability is needed. |
| metadata | {"author":"dtsong"} |
Update a pull request's branch with the latest changes from the base branch.
/gh-pr-update # Update current PR's branch
/gh-pr-update 123 # Update PR #123's branch
/gh-pr-update --rebase # Rebase instead of merge
/gh-pr-update --local # Update locally and push
Uses GitHub's API to update the branch without local checkout:
# Using gh CLI
gh pr update-branch $PR_NUM
# Using GitHub MCP
mcp__github__update_pull_request_branch(owner, repo, pr_number)
For more control or when API update isn't available:
# Switch to PR branch
git checkout feat/dark-mode
# Merge main into the branch
git merge origin/main
# Or rebase onto main
git rebase origin/main
# Push updated branch
git push origin feat/dark-mode
# Or force push if rebased
git push --force-with-lease origin feat/dark-mode
Updating PR #123 branch...
Before:
Branch: feat/dark-mode
Behind main by: 5 commits
Ahead of main by: 3 commits
Updating via GitHub...
After:
✓ Branch updated successfully
Behind main by: 0 commits
Ahead of main by: 8 commits (3 original + 5 merged)
New commits from main:
abc1234 Fix security vulnerability
def5678 Update dependencies
ghi9012 Performance improvements
jkl3456 Bug fix
mno7890 Documentation update
CI checks will re-run automatically.
Check status with: /gh-pr-status
Updating PR #123 branch locally...
Fetching origin/main...
Merging main into feat/dark-mode...
Merge complete! Pushed to origin.
Updated commits:
your-commit-1 Your changes
your-commit-2 More changes
merge-commit Merge branch 'main' into feat/dark-mode
Branch is now up to date with main.
PR #123 branch is already up to date with main.
No update needed.
Cannot auto-update PR #123 branch.
Reason: Merge conflicts detected
Conflicting files:
- src/components/Header.tsx
- src/api/auth.ts
To resolve:
1. Update locally:
git checkout feat/dark-mode
git merge origin/main
2. Resolve conflicts:
/git-conflicts
3. Push resolved branch:
/git-push
Or use rebase:
/gh-pr-update --rebase --local
Rebasing PR #123 onto main...
Rebasing 3 commits:
abc1234 Add theme component
def5678 Wire up context
ghi9012 Add styles
Rebase successful!
Note: Force push required (history rewritten)
Pushing with --force-with-lease...
Branch updated. CI will re-run.
Warning: Any local clones of this branch will need to reset:
git fetch origin
git reset --hard origin/feat/dark-mode
| Method | Pros | Cons |
|---|---|---|
| Merge | Safe, no force push | Adds merge commit |
| Rebase | Clean linear history | Requires force push |
Recommendation:
If base branch has protection requiring updates:
Branch protection requires update before merge.
Repository setting: "Require branches to be up to date"
Options:
/gh-pr-update # Update branch with main
/gh-pr-update --rebase # Rebase onto main
After update, CI will re-run (required for merge).
When rebasing requires force push:
Rebase complete. Force push needed.
Safety checks:
✓ No new commits on remote since last fetch
✓ Using --force-with-lease (safer)
⚠️ Will rewrite 3 commits
This is safe because:
- You're the only one working on this branch
- Or: All collaborators are aware
Proceed with force push? [y/n]
/gh-pr-status to check if update is needed/git-merge-main for local merge approach/git-rebase for local rebase approach/gh-pr-merge after update succeedsConverted and distributed by TomeVault — claim your Tome and manage your conversions.