push

Publish local Git branch commits to a remote while preserving uncommitted and remote work.

Updated Sep 17, 2026
One-click install
npx skills add https://github.com/hkw2028/toy-project --skill push-hkw2028
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: push
Source: https://github.com/hkw2028/toy-project/tree/main/.agents/skills/push
Command: npx skills add https://github.com/hkw2028/toy-project --skill push-hkw2028

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Pushing Git branches often risks losing work: dirty files get swept into commits, a teammate's remote commits get overwritten by force pushes, or detached-HEAD commits disappear. This Skill publishes only existing local commits to a remote branch while protecting local and remote work. ## Core Features & Use Cases - Safe Branch Publication: Pushes the current or named branch to origin or another remote and establishes upstream tracking for later work. - Dirty Worktree Protection: Leaves uncommitted changes local and reports them as not included instead of turning a push into a commit. - Lease-Protected Updates: After a rebase rewrites published history, uses force-with-lease against freshly observed remote state and refuses to overwrite unexpected remote changes. - Detached HEAD Recovery: Derives a concise branch name from the change and publishes detached commits without touching the protected default branch. - Use Case: You rebased onto origin/main and your branch history diverged from the remote. The Skill verifies the divergence is expected, applies a lease-protected update, and confirms the resulting remote commit. ## Quick Start Ask the assistant to push the current branch to origin while keeping your uncommitted files local.

Frequently Asked Questions about push

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

FAQPage Schema
How do I push a Git branch without committing dirty files?

Push only publishes existing commits, so uncommitted changes in the working tree stay local and untouched. The Skill reports dirty files as not included rather than staging or committing them first.

How to safely force push after a Git rebase?

Use a lease-protected update (force-with-lease) against the freshly observed remote state. This updates the remote only if it still matches what you last fetched, so an unexpected remote change blocks the push instead of being overwritten.

What happens if someone else pushed to the same remote branch?

The Skill fetches and inspects the current remote branch first, then reconciles the other contributor's commits with yours before publishing. It never overwrites their work with an unconditional force push.

Can I push commits from a detached HEAD state?

Yes. The Skill derives a concise branch name from the change, creates a named branch pointing at the detached commit, and publishes that branch to the remote so the commit is not lost.

Does this Skill create pull requests or commit changes?

No. It only pushes existing commits to a remote branch and sets upstream tracking. Committing dirty changes, creating PRs, and merging are explicitly out of scope and handled by separate workflows.