git-pre-push

Automates Git pre-push checks displaying branch, status, and upstream information via Bash script.

Updated Jun 18, 2025
One-click install
npx skills add https://github.com/ekozmdev/my-codex-cli-settings --skill git-pre-push
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-pre-push
Source: https://github.com/ekozmdev/my-codex-cli-settings/tree/main/.agents/skills/git-pre-push
Command: npx skills add https://github.com/ekozmdev/my-codex-cli-settings --skill git-pre-push

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill consolidates the pre-push checks into a single script, helping developers verify local changes and upstream status before pushing, reducing accidental pushes and broken histories.

Core Features & Use Cases

  • Unified pre-push checks: Runs a sequence of git commands to show the current branch, status, and upstream information.
  • Safety checks before pushing: Alerts user to uncommitted changes or misaligned upstreams, aiding careful collaboration.
  • Use Case: A developer working on feature branches can run this script to confirm the working tree status and upstream differences before pushing to the shared repository.

Quick Start

Execute the script to perform the checks on your repository, for example: bash ~/.agents/skills/git-pre-push/scripts/pre_push_check.sh

Frequently Asked Questions about git-pre-push

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

FAQPage Schema
How do I run pre-push checks for my git branch before pushing?

You can run pre-push checks by executing a Bash script that displays your current branch, working tree status, and upstream information to validate your local repository state before pushing.

What git status information should I review before pushing to an upstream repository?

Before pushing to an upstream repository, you should review your current git branch, uncommitted local changes, and upstream alignment to prevent accidental pushes and broken histories.

How do I automate safety checks to prevent accidental git pushes on feature branches?

You can automate safety checks by running a pre-push Bash script that consolidates git commands to alert you to uncommitted changes or misaligned upstreams before pushing to shared repositories.

Can I use a pre-push check script without installing additional dependencies?

Yes, the pre-push check script relies solely on standard Bash commands and built-in git commands to verify your local repository state, requiring no additional dependencies to run.

Does this pre-push check work with typical git workflows on collaborative repositories?

Yes, the pre-push check is designed for typical git workflows on feature branches and collaborative repositories where push decisions depend on branch status and upstream relationships.

Why does my git push fail when my upstream is misaligned?

Git pushes can fail due to misaligned upstreams because your local branch and the remote repository have diverged histories, which a pre-push check identifies by displaying upstream differences.