push

Verify remote URL and branch before pushing local commits.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/captainsparrow10/LLM-ENGINEERS-HANDBOOK --skill push-captainsparrow10
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: push
Source: https://github.com/captainsparrow10/LLM-ENGINEERS-HANDBOOK/tree/main/.claude/skills/push
Command: npx skills add https://github.com/captainsparrow10/LLM-ENGINEERS-HANDBOOK --skill push-captainsparrow10

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pushes local commits safely by verifying the remote and current branch before pushing, preventing accidental pushes to wrong repositories or main branches.

Core Features & Use Cases

  • Remote verification: checks that the remote URL points to the intended repository (e.g., origin points to your GitHub repo).
  • Branch validation: ensures you're not pushing from an unintended branch and discourages force pushes to main.
  • Safe push workflow: previews what will be pushed and performs the push with appropriate upstream tracking when needed.
  • Error handling: guides the user through common issues like incorrect remotes, permissions, or non-fast-forward rejections.

Quick Start

Push the current local branch to the correct remote only after confirming the remote URL and current branch.

Frequently Asked Questions about push

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

FAQPage Schema
How do I prevent accidental git pushes to the main branch?

A safe git push workflow prevents accidental pushes to the main branch by validating the current branch and verifying the remote URL before transferring any local commits. It blocks unintended force pushes and guides you through mismatch errors.

What is the safest way to verify a remote repository before pushing commits?

The safest way to verify a remote repository before pushing commits is to enforce a remote URL check against the intended origin. This validation prevents pushing local code to the wrong GitHub repository or incorrect remote endpoint.

How do I handle non-fast-forward rejections when running a git push?

Handling non-fast-forward rejections during a git push requires clear error handling that guides you through common mismatch issues. The workflow detects the rejected update and prevents the unsafe push from completing without resolution.

Can I preview what local commits will be pushed before sending them to the remote?

Yes, a safe git push workflow previews what local commits will be transferred to the remote repository before executing the push. This allows you to verify the branch and remote URL while ensuring proper upstream tracking is set.

Does a guarded git push workflow stop force pushes to protected branches?

A guarded git push workflow does stop force pushes to protected branches by enforcing strict branch validation. It discourages pushing from unintended branches and ensures the main branch remains protected against destructive updates.