一键导入
git-rebase-main
Safely rebase the current feature branch on top of the latest origin/main. Use when preparing a branch for PR, UAT, or release.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Safely rebase the current feature branch on top of the latest origin/main. Use when preparing a branch for PR, UAT, or release.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create and (optionally) merge a GitHub pull request (prefer GitHub chat tools; gh/wrappers are fallback), following the repo policy to use rebase and merge for a linear history.
Export and analyze VS Code Copilot chat logs for retrospective metrics. Extracts model usage, tool invocations, approval patterns, and timing data.
Generate the comprehensive demo markdown artifacts from the current codebase. Use before UAT to ensure test artifacts reflect the latest code.
Regenerate test snapshot files after intentional markdown output changes. Use after modifying templates or rendering logic.
Run User Acceptance Testing by creating a PR with rendered markdown on GitHub or Azure DevOps. Use when validating markdown rendering in real platforms.
Simulate the UAT workflow (create PR, comment, poll) on GitHub or Azure DevOps using a minimal test artifact and simulated fixes.
| name | git-rebase-main |
| description | Safely rebase the current feature branch on top of the latest origin/main. Use when preparing a branch for PR, UAT, or release. |
Ensure the current feature branch includes all the latest changes from main before proceeding with code review, UAT, or release. This prevents merge conflicts and ensures tests run against the latest codebase.
main before rebasing.# Ensure we're not on main
current_branch=$(git branch --show-current)
if [[ "$current_branch" == "main" ]]; then
echo "ERROR: Cannot rebase main onto itself. Switch to a feature branch first."
exit 1
fi
# Ensure working directory is clean
if [[ -n "$(git status --porcelain)" ]]; then
echo "ERROR: Working directory has uncommitted changes. Commit or stash them first."
exit 1
fi
git fetch origin
git rebase origin/main
If the rebase fails due to conflicts:
git rebase --continue.After a successful rebase, the branch history has changed. Ask the user before force-pushing:
git push --force-with-lease origin HEAD
$ git fetch origin && git rebase origin/main
First, rewinding head to replay your work on top of it...
Applying: feat: add new formatting option
$ git push --force-with-lease origin HEAD