# Commit And Push

> Commit whatever is currently staged (if anything) and push. Use when the user says "commit and push", "ship it", or similar. Pushes even when there's nothing new to commit, so it also ships already-made local commits. Does not stage anything. For commit-only, use commit.

- Skill: `prostdev/commit-and-push` (Agent Skill)
- Install (CLI): `npx skillmds@latest add prostdev/commit-and-push`
- Raw SKILL.md: https://api.skillmd.com/api/skills/prostdev/commit-and-push/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: ProstDev (https://skillmd.com/u/prostdev)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/prostdev/commit-and-push

---


# Commit and Push

Commit the currently staged changes (if any), then push. Do not `git add`, do not stage untracked
or unstaged files.

## Steps

1. `git diff --cached --stat` — check what's staged.
   - **Something staged:** commit it, following the message rules in the [commit](../commit/SKILL.md)
     skill (`type: summary`, staged only, no `-a`).
   - **Nothing staged:** skip committing — do NOT stage anything. Continue to push anyway (there may
     be earlier local commits to ship).
2. `git push`. If the branch has no upstream, `git push -u origin HEAD`.
3. Report what happened: the commit hash + message if one was made (or "nothing to commit"), and the
   push result — including "already up to date" if nothing was pushed.

## Don't

- Don't stage anything (`git add`, `git commit -a`, `git commit <path>`).
- Don't amend, rebase, or force-push.
- Don't touch other branches or open a PR.
