Push the current branch to origin safely (lint, test, resolve non-fast-forward via pull skill, then push). Use when the user asks to push or publish commits to the remote. Does not create or edit PRs—use the create-pr-jp skill for that.
origin safely.origin is configured and reachable.git push work for this host (HTTPS or SSH).git status, git remote -v, git fetch as needed).pnpm lint then pnpm test (or pnpm lint && pnpm test), unless the repo documents different pre-push checks.origin, setting upstream tracking if needed (git push -u origin HEAD).origin/main or the appropriate base), resolve conflicts, re-run pnpm lint && pnpm test, then push again. Use --force-with-lease only when history was rewritten intentionally.git push to origin for the current branch (and upstream set when first pushing the branch).Reference flow (adapt branch names and commands to the repo):
branch=$(git branch --show-current)
# Validation gate (lint then test; use repo-specific scripts if documented)
pnpm lint && pnpm test
# Push (with upstream tracking on first push)
git push -u origin HEAD
# If the remote moved: resolve via the pull skill, re-run `pnpm lint && pnpm test`, then:
# git push -u origin HEAD
# Auth/permission failures: show the error and stop—do not force-push to fix.
# Only after intentional history rewrite:
# git push --force-with-lease origin HEAD
origin succeeded.--force. Use --force-with-lease only as a last resort when history was intentionally rewritten.| Situation | Action |
|---|---|
non-fast-forward / behind remote | pull skill → merge/rebase per repo rules → pnpm lint && pnpm test → push again |
| Credential / permission denied | Report verbatim; user fixes credentials or repo access—do not bypass with force push |
| Wrong remote or branch | Verify git branch --show-current and origin URL before pushing |