git-push

Gate git pushes by scanning commits for secrets and divergence.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/shellicar/skills --skill git-push-shellicar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-push
Source: https://github.com/shellicar/skills/tree/main/skills/git-push
Command: npx skills add https://github.com/shellicar/skills --skill git-push-shellicar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires git, jq, gh, az, and includes scripts (resource) components.

What problem does it solve?

Prevents local commits from being pushed when they would violate branch protection rules, have upstream problems, contain secrets or PII, or when the branch has diverged, avoiding accidental history corruption or secret leaks.

Core Features & Use Cases

  • Branch protection gating: Detects protected branches and stops direct pushes, offering branch creation or PR options.
  • Upstream and divergence checks: Detects missing or deleted upstreams and behind/ahead divergence to avoid unsafe pushes.
  • Secret and PII scanning workflow: Uses commit diffs to scan only relevant files and refuses pushes with confirmed secret findings until approved.
  • Platform-aware automation: Integrates with GitHub and Azure DevOps via CLI checks and suggests the appropriate PR workflow when needed.

Quick Start

Run the git-push workflow to gather push state, scan commits for secrets and divergence, and only proceed with git push after confirming findings.

Frequently Asked Questions about git-push

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

FAQPage Schema
How do I prevent pushing secrets or PII to a remote git repository?

To prevent pushing secrets, gate git push commands by computing commit diffs and scanning them for sensitive data. The push is blocked until secret findings are reviewed or approved, avoiding accidental data leaks.

How do I stop direct pushes to protected branches in GitHub or Azure DevOps?

To stop direct pushes to protected branches, use a push gating script that detects protected branches and blocks the push. It then suggests creating a new branch or submitting a pull request instead of pushing directly.

How does upstream divergence detection work for local git branches?

Upstream divergence detection works by collecting local and remote state to compute ahead and behind commit counts. It identifies missing or deleted upstreams and stops unsafe pushes before they corrupt history.

Do I need the gh or az CLI to gate git pushes?

You need git and jq to run the core push gating scripts. The gh or az CLIs are optional but required for platform-aware automation to detect branch protection rules across GitHub and Azure DevOps.

What happens when a local branch has a missing or deleted upstream?

When a branch has a missing or deleted upstream, the push gating workflow detects the anomaly and blocks the push. It prevents unsafe operations and suggests the appropriate branch creation or pull request workflow.