push
SKILL.md
Push
Purpose
- Push the current branch to
originsafely. - Keep branch history clean when the remote has moved forward (coordinate with pull as needed).
Prerequisites
- Git remote
originis configured and reachable. - Credentials for
git pushwork for this host (HTTPS or SSH).
When to Use
- "pushして", "リモートに出して", "origin に push", or similar—when the user asks to push commits to the remote.
Do Not Use When
- Only syncing or updating the local branch is needed (use the pull skill).
- The user wants a PR opened or updated (use the create-pr-jp skill—out of scope for this skill).
Related Skills
- pull: When push is rejected or the branch is not cleanly synced (non-fast-forward, merge conflicts, branch behind remote).
- create-pr-jp: When the user wants to create or update a GitHub PR (Japanese title/body per repo rules).
Procedure
- Identify the current branch and inspect remote state (
git status,git remote -v,git fetchas needed). - Run local checks before pushing:
pnpm lintthenpnpm test(orpnpm lint && pnpm test), unless the repo documents different pre-push checks. - Push to
origin, setting upstream tracking if needed (git push -u origin HEAD). - If push fails or is non-fast-forward:
- For non-fast-forward or sync issues: use the pull skill to merge or rebase per repo rules (
origin/mainor the appropriate base), resolve conflicts, re-runpnpm lint && pnpm test, then push again. Use--force-with-leaseonly when history was rewritten intentionally. - For auth, permissions, or host policy: do not rewrite the remote or change protocols; show the exact error and stop.
- For non-fast-forward or sync issues: use the pull skill to merge or rebase per repo rules (
Output
- A successful
git pushtooriginfor the current branch (and upstream set when first pushing the branch).
Usage
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
Present Results to User
- Confirm the branch name and that the push to
originsucceeded. - If push failed, report the exact error and what was tried (e.g. pull/rebase)—do not imply a PR was created or updated (that is create-pr-jp’s job).
Notes
- Never use
--force. Use--force-with-leaseonly as a last resort when history was intentionally rewritten. - Distinguish sync issues from auth/permission issues: resolve the former with pull; for the latter, surface errors without changing remotes or protocols.
Troubleshooting
| 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 |
Weekly Installs
4
Repository
noblejasper/agent-skillsFirst Seen
Today
Security Audits
Installed on
amp4
cline4
opencode4
cursor4
kimi-cli4
warp4