From yangsonhung-awesome-agent-skills
提交并推送工作分支,再合并到主分支并推送双分支结果,最后切回工作分支。适用于需要同步副分支到主分支的 Git 发布同步场景。
How this skill is triggered — by the user, by Claude, or both
Slash command
/yangsonhung-awesome-agent-skills:git-push-secondary-merge-primary-cnThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
执行标准的双分支交接流程:在副分支完成工作并推送,再合并到主分支并推送,最后切回副分支。
执行标准的双分支交接流程:在副分支完成工作并推送,再合并到主分支并推送,最后切回副分支。
dev、develop 或其他集成分支。main 或 master。这个流程适合需要同时推送副分支和主分支的发布同步场景,并尽量保留主分支上清晰的合并结果。
当用户要求执行以下操作时使用本技能:
dev → main 或 develop → master以下场景不要使用本技能:
git-weekly-report-cn)code-reviewer 或 frontend-code-review)先按分支识别规则确定主分支和副分支,再按工作流程顺序执行。遇到分支名不明确、合并冲突、脏工作区或推送被拒绝且无法安全处理时,停止并说明阻塞原因,不要猜测执行。
dev 或 main,但仓库实际使用 develop 或 master 时,先核对真实分支再选择。git symbolic-ref refs/remotes/origin/HEAD 识别主分支。main,其次 master。dev,其次 develop。检查仓库状态。
git status --short、git branch --show-current、git remote -v。<secondary_branch> 和 <primary_branch>。将工作切换到 <secondary_branch>。
<secondary_branch> 上则继续。git checkout <secondary_branch> 与 git pull --ff-only origin <secondary_branch>。如果 <secondary_branch> 上有本地改动,先提交。
git add 暂存相关变更,除非用户要求更小的范围。type(scope): 前缀 + 冒号后接中文摘要。--no-verify。<secondary_branch> 无本地改动,跳过提交直接进入推送步骤。推送 <secondary_branch>。
git push origin <secondary_branch>。git fetch 并查看再重试;除非用户明确要求,否则不执行强制推送。合并到 <primary_branch>。
git checkout <primary_branch>。git pull --ff-only origin <primary_branch>。<primary_branch> 未包含 <secondary_branch> 时,使用 git merge --no-ff <secondary_branch> -m "chore(<primary_branch>): 合并 <secondary_branch> 到 <primary_branch>" 保留合并提交。推送 <primary_branch>。
git push origin <primary_branch>。切回 <secondary_branch>。
git checkout <secondary_branch>。git status --short 和 git branch --show-current 复核。<secondary_branch>。保持最终回复简洁。包含成功推送的分支与提交哈希。若宿主应用支持 Git 指令,仅在对应 Git 动作成功后再发出相关指令。
npx claudepluginhub yangsonhung/awesome-agent-skillsCommits and pushes a work branch, then merges it into the primary branch and pushes both. Useful for two-branch release-sync handoffs.
Merges current branch into a target branch, pushes if remote exists, then returns to original branch. Useful for syncing work branches without staying on target.
Runs verification checks, reviews the diff, picks the integration path (merge, PR, squash, stacked PR), writes the PR/merge message, pushes, and cleans up branches and worktrees.