Push local commits to remote. Use when need to push commits to remote. Triggers on "推送", "push", "gh-push", "/gh-push", "推上去".
Instalação
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Push local commits to remote. Use when need to push commits to remote. Triggers on "推送", "push", "gh-push", "/gh-push", "推上去".
allowed-tools
Bash, Read
version
1.0.0
scope
public
evolution
{"enabled":true,"version":"1.0.0","stability":"stable","auto_evolve":"patch","created":"2026-02-12T00:00:00.000Z","updated":"2026-02-12T00:00:00.000Z","history":[{"version":"1.0.0","date":"2026-02-12","note":"Split from gh-commit-and-push"}]}
GH Push
Push local commits to the remote repository.
Integrations
upstream:
- skill: gh-commit
receives: Committed but unpushed commits
downstream:
- output: git pushed to remote
produces: Remote branch updated
If on main/master, ask the user if they are sure they want to push directly
Phase 2: Account Switch + Safety Checks
Switch gh auth to the correct account
Determine the required account based on directory:
Path
GH Account
~/work/
pdyei
~/personal/, ~/site/
panda850819
# Check current active account
gh auth status 2>&1 | grep "Active account: true" -B2 | head -1
# If not the expected account, switch
gh auth switch --user <expected-account>
Display before switching: Pushing as [account]
If directory is not in a known path, determine from remote URL (Yei-Finance org -> pdyei)
Confirm remote status
git fetch --dry-run 2>&1
If remote has new commits, prompt to pull first
Phase 3: Push
Push to remote
git push
If this is a new branch (no upstream):
git push -u origin <branch-name>
Safety and Escalation
Situation
Action
On main/master branch
Ask user to confirm
Remote has new commits
Prompt to run git pull
git push failed
Display error, prompt for manual handling
No unpushed commits
Notify user, stop
No remote configured
Prompt to set up remote
Verification
# Confirm pushed to remote
git status
# Confirm remote branch status
git log --oneline -3