commit-and-push

Commit staged changes and push the current branch to its upstream.

22|3|Updated Jul 28, 2024
One-click install
npx skills add https://github.com/webdevcody/go-mailing-list --skill commit-and-push-webdevcody
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: commit-and-push
Source: https://github.com/webdevcody/go-mailing-list/tree/main/.claude/skills/commit-and-push
Command: npx skills add https://github.com/webdevcody/go-mailing-list --skill commit-and-push-webdevcody

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It eliminates the friction of manually running separate git commit and git push steps, ensuring changes are only pushed after a fresh grouped commit.

Core Features & Use Cases

  • Grouped commit via existing commit skill: Delegates commit composition and message discipline to the commit skill to keep history organized.
  • Safe push with upstream awareness: Pushes the current HEAD to its existing upstream when available, or sets upstream with -u origin <branch> on first push.
  • No-op when nothing changed: Detects a clean working tree and avoids pushing stale or unrelated local history.
  • Safety guardrails: Never force-pushes and stops when non-fast-forward rejection occurs, prompting a rebase-based workflow.

Quick Start

Ask the AI to run commit-and-push to group and commit your working tree changes, then push the current branch to the remote.

Frequently Asked Questions about commit-and-push

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

FAQPage Schema
How do I commit and push git changes in a single step?

To commit and push git changes in one step, the workflow delegates commit message composition to a dedicated commit skill, then safely pushes the current HEAD to its remote branch. It automatically checks upstream tracking and uses git push -u origin for first-time publishing.

What happens if I run a commit and push action with a clean working tree?

Running a commit and push action with a clean working tree results in a no-op. It detects that nothing changed and avoids empty commits, preventing stale or unrelated local history from being pushed to the remote repository.

Does the automated git push workflow force-push to the remote branch?

The automated git push workflow never force-pushes to the remote branch. It includes safety guardrails that stop on non-fast-forward rejection, prompting a rebase-based workflow to safely resolve divergent histories.

How does the push command handle a local branch with no upstream set?

For a local branch with no upstream set, the workflow checks tracking existence via git rev-parse @{u} and falls back to git push -u origin <branch>. This establishes the remote tracking relationship during the first push.

What is the safest way to automate git commit and push for local repository changes?

The safest way to automate git commit and push is to group staged changes into a fresh commit, verify upstream tracking, and push without force. This approach avoids empty commits and handles non-fast-forward rejections by stopping for a manual rebase.