git-push-branch

Commits and pushes feature-branch changes to update an open pull request.

Updated Dec 18, 2025
One-click install
npx skills add https://github.com/l0lxl0lw/dotfiles --skill git-push-branch-l0lxl0lw
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-push-branch
Source: https://github.com/l0lxl0lw/dotfiles/tree/main/ai/shared/skills/git/git-push-branch
Command: npx skills add https://github.com/l0lxl0lw/dotfiles --skill git-push-branch-l0lxl0lw

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? It automates the everyday loop of committing local changes on a feature branch and pushing them to update an open PR, while guarding against common mistakes like pushing behind the upstream, force-pushing published history, or publishing repo-local drift. ## Core Features & Use Cases - Branch Analysis: Inspects staged/unstaged changes, unpushed commits, upstream drift, open PR status, and CI checks before acting. - Single-Gate Commit Flow: Proposes a commit message and combines the squash-versus-stack choice and push approval into one confirmation dialog. - Repo-Local Pre-Push Checks: Runs REQUIRED checks declared by the repository (spec drift, stale generated artifacts) and blocks the push on failure. - Use Case: After addressing review comments on a PR, run this Skill to stage the fixes, commit with a reviewer-friendly message, run the repo's declared checks, and push so the PR updates and CI reruns. ## Quick Start Ask the assistant to commit and push my current changes to update my open PR.

Frequently Asked Questions about git-push-branch

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

FAQPage Schema
How do I commit and push changes to update an open pull request?

Run this Skill on the feature branch: it analyzes the working tree, proposes a commit message, and after one confirmation stages, commits, and pushes. The existing PR updates automatically with the new commits.

How do I squash new changes into the last unpushed commit?

When unpushed commits exist, the confirmation dialog offers a squash option that amends the last commit with the new message via create-commit.sh --amend, then pushes. Amending an already-pushed commit requires explicit force-push confirmation.

Can I use this on the main or master branch?

No. The analysis script exits with code 2 on the default branch and the Skill refuses to run there. Use the companion git-push-to-main Skill, which has guardrails designed for the default branch.

What happens if someone else pushed to my feature branch?

The analysis detects the branch is behind its own upstream and the Skill pulls with git pull --ff-only before pushing. If the branch has diverged and cannot fast-forward, it stops and surfaces the conflict instead of forcing.

Why did the push stop after a repo-local check failed?

Repositories can declare REQUIRED pre-PR checks in their own skills' frontmatter. A failing check means the push would publish drift, so the Skill stops and asks whether to fix the drift, push anyway, or abort.

Does it prevent committing secrets or sensitive files?

Yes. The stage-files.sh script warns about files matching patterns like .env, .pem, .key, .secret, .credentials, and .token, and excludes them from automatic staging. They can only be added manually with git add.