git-push
GitHub在提交后推送分支,通过检查状态确保安全。拒绝保护分支和未暂存更改的推送。处理推送拒绝时请求用户确认重基或强制操作,并报告详细结果。
Trigger Scenarios
Install
npx skills add Terry-Mao/AICodingFlow --skill git-push -g -y
SKILL.md
Frontmatter
{
"name": "git-push",
"description": "Push committed branch work to the correct remote branch with minimal checks and no unsafe force pushes."
}
git-push
Use after commits exist and the user asks to push or publish the branch.
Inspect
Use one tool call for push state:
git status --short
git branch --show-current
git rev-parse --abbrev-ref --symbolic-full-name @{u}
git log --oneline @{u}..HEAD
If upstream lookup fails, prepare git push -u origin <branch> and use recent local commits only when the commit set is unclear.
Push
- Refuse protected/shared base branches (
main,master,develop, release branches) unless explicitly asked. - Dirty worktree changes are not pushed; report them and continue only when pushing existing commits is still clearly intended.
- Use normal push so hooks run:
git push
git push -u origin <branch>
Rejections
If push is rejected, then fetch and inspect divergence. Ask before rebasing, merging, or using git push --force-with-lease. Never use plain git push --force unless the user explicitly requests that exact behavior.
Report current branch, upstream/remote branch, pushed commit hash, push result, and dirty changes that were not pushed.
Version History
- e53c5ac Current 2026-07-24 11:35


