git-push

Push existing local commits to the remote default branch with rebase-and-retry handling.

2|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/witwave-ai/witwave --skill git-push-witwave-ai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: git-push
Source: https://github.com/witwave-ai/witwave/tree/main/.agents/self/iris/.claude/skills/git-push
Command: npx skills add https://github.com/witwave-ai/witwave --skill git-push-witwave-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Publishing local commits to a shared remote branch is error-prone in multi-agent or multi-collaborator environments: pushes get rejected by non-fast-forward races, force-push flags destroy history, and silent failures leave work unpublished. This Skill performs only the safe push step, with guardrails against dangerous flags and a defined recovery path. ## Core Features & Use Cases - Idempotent push check: Counts commits ahead of and behind the remote before pushing, exiting cleanly as a no-op when there is nothing to publish. - Footgun refusal: Rejects any request containing --force, --force-with-lease, --no-verify, or --no-gpg-sign flags before running anything. - Race recovery: On a non-fast-forward rejection, fetches, rebases onto the remote branch, and retries the push exactly once, then stops and surfaces the state if it still fails. - Stuck-state logging: Appends structured failure entries to a memory file so a coordinating agent can pause dispatches and escalate until the blockage resolves. - Use Case: An autonomous coding agent finishes committing a bug fix locally and asks to publish the work; the Skill verifies there are commits to push, pushes to origin, handles a sibling agent's concurrent push via rebase, and confirms the local and remote branches match. ## Quick Start Push my local commits to the remote default branch and let me know if anything gets stuck.

Frequently Asked Questions about git-push

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I push local commits to a remote git branch safely?▼

Check how many commits are ahead of the remote with git rev-list, then run git push origin <branch>. If rejected as non-fast-forward, fetch, rebase onto the remote branch, and retry the push once before stopping to surface the error.

How to handle git push rejected non-fast-forward errors?▼

A non-fast-forward rejection means someone else pushed first. Run git fetch origin, git rebase origin/<branch>, then push again. If the rebase conflicts or the second push fails, stop and surface the state rather than retrying or force-pushing.

Does this skill commit or stage changes before pushing?▼

No. The skill only pushes commits that already exist in local history. Staging files, writing commit messages, and creating commits are explicitly out of scope and must happen beforehand.

Can I use force-push or --no-verify with git push?▼

No. The skill refuses any request containing --force, -f, --force-with-lease, --no-verify, or --no-gpg-sign. These flags are disallowed to prevent history destruction and hook bypasses, and exceptions require explicit user approval.

Why does git push fail with 401 or 403 authentication errors?▼

A 401 or 403 means the remote rejected the credentials, typically because the token expired, rotated, or was misconfigured in the environment. Surface the error verbatim and verify the credential environment variables rather than retrying.