帮助你同步当前分支与上游分支,完成拉取、变基、推送或发布操作
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "sync" 技能: 1. 下载 https://raw.githubusercontent.com/microsoft/vscode/main/src/vs/sessions/skills/sync/SKILL.md 2. 保存为 ~/.claude/skills/sync/SKILL.md 3. 装好后重载技能,告诉我可以用了
请把我当前分支与上游分支同步,先拉取最新改动并按需变基,确保分支是最新状态。
完成当前分支与上游分支的同步,并反馈是否拉取、变基成功或存在冲突。
请将我当前分支推送到远程仓库,如果已经配置上游分支就直接同步推送。
当前分支被成功推送到远程,并说明推送目标分支与执行结果。
请把我当前本地分支发布到远程,并为它设置上游分支,方便后续直接 pull 和 push。
当前本地分支已发布到远程并完成上游关联设置,可直接继续同步操作。
Sync the current session branch with its upstream branch, or publish the current session branch to a remote. Use when the user asks to sync a branch, pull latest changes, rebase onto upstream, push current branch, publish branch, or set upstream.
--force, --force-with-lease) without explicit user approval.--no-verify)./commit skill to commit them before continuing.git fetch <upstream-remote>
3.2. Check ahead/behind counts. If the branch is already in sync (0 ahead, 0 behind), stop and report that no sync is needed.
3.3. If behind, rebase onto the upstream tracking branch.
3.4. If there are merge conflicts, resolve them by preserving the intent of both sides. Stage the resolved files and continue the rebase.
If conflict resolution is unclear, ask the user how to proceed. If the user wants to stop the rebase, abort it:
3.5. If the branch has local commits (ahead > 0), push them to the remote after a successful rebase.
If the push is rejected because the rebase rewrote history, explain the situation to the user and ask for approval before force-pushing.git rev-list --left-right --count HEAD...@{u}
git rebase @{u}
git add <resolved-files>
git rebase --continue
git rebase --abort
git push
git push -u <remote> HEAD
After the workflow completes, validate the result with explicit checks:
git status --porcelain
git rev-list --left-right --count HEAD...@{u}
git rev-parse --abbrev-ref --symbolic-full-name @{u}
帮助开发者验证 Azure DevOps 流水线改动,快速排查构建与 YAML 配置问题。
帮助你创建、切换并检查代码分支,确保实现前遵循正确分支策略。