Skip to main content

GitPush Tool 🚀

PyPI version License: MIT

A supercharged Git CLI and safety tool that simplifies repository creation and pushing with intelligent defaults, rich pre-push diffstat inspection (+++--- lines), and active safeguards against dangerous Git commands.


✨ Features

  • Decision-Support Status Dashboard (gitpush status): Actionable repository overview showing worktree breakdown, commit sync, intelligent next-step recommendations, and a 0-100 Repo Health score.
  • Pre-Push Safety & Diffstat Preview: See changed files, line additions/deletions (+X, -Y), ahead/behind status, and pending commits before pushing.
  • Dangerous Git Operation Guard: Analyzes and protects against risky actions (reset --hard, force pushes, deleting unmerged branches, dirty git clean, detached HEADs).
  • Protected Branch Safeguard: Automatically detects and alerts when pushing or force-pushing to main, master, prod, release, or dev.
  • One-Command GitHub Repo Creation: Initialize Git, create a remote GitHub repo, and push in a single step via GitHub CLI (gh).
  • Safe Force Pushing: Uses --force-with-lease by default to avoid overwriting teammate commits.
  • Dry-Run Mode: Preview your push inspection without modifying anything.
  • Non-Interactive & CI Friendly: Skip prompts with -y or --yes.

📊 Decision-Support Status Dashboard (gitpush status)

Repository:  my-project
Branch:      feature/payment
Tracking:    origin/feature/payment

WORKTREE
────────────────────────
Modified       4
Added          2
Deleted        1
Untracked      3
Line Changes   +142, -18

COMMITS
────────────────────────
Ahead          3
Behind         1

PUSH / STATUS
────────────────────────
⚠ Remote has 1 commit(s) you don't have locally.

Recommended:
    git pull --rebase
    gitpush "Commit message"

Health:
    82/100 [████████░░] Good (Minor Action Needed)

🛡️ Pre-Push Warning & Inspection

Whenever you run gitpush, you get an instant, clear breakdown of your repository state:

═══════════════════════════════════════════════════════════════
 🚀 GITPUSH PRE-PUSH INSPECTION & SUMMARY
═══════════════════════════════════════════════════════════════

Repository:    my-project (/Users/username/Projects/my-project)
Target Branch: main ⚠️ [PROTECTED BRANCH]  ──>  origin/main
Sync Status:   Ahead: 2 commit(s), Behind: 0 commit(s)
Action:        Commit: 'Add user authentication flow'

Warnings:
  ⚠️  Pushing directly to protected branch 'main'.

Changed Files (3 file(s), +84 / -12):
  M   src/auth.py                          (+65, -8)
  M   README.md                            (+19, -4)
  ??  config/auth.json                     (+12 lines, untracked)

Pending Commits to Push (2):
  • 8f3d1a2 Initial auth scaffold
  • 4e9c7b1 Implement JWT token verification
═══════════════════════════════════════════════════════════════

Continue? [y/N]:

🛑 Dangerous Command Guard

Use gitpush guard <command> (or gitpush-guard <command>) before executing risky Git operations:

Command: [WARNING ⚠️]
    git reset --hard HEAD~5

Changes that may be lost:
    5 commit(s)
    12 modified/staged file(s)

Risks & Warnings:
    ⚠️  All uncommitted changes in tracked files will be permanently discarded.
    ⚠️  12 uncommitted modified/staged file(s) will be lost immediately.
    ⚠️  5 commit(s) will be unlinked from current branch HEAD.

Repository:
    my-project

Continue? [y/N]:

What Guard Detects:

  • reset --hard: Identifies uncommitted files and commits that will be orphaned.
  • force push: Detects remote overwrite risks and protected branch overrides.
  • deleting branches: Identifies unmerged commits that would be lost.
  • cleaning untracked files: Warns of files/directories git clean -fd will permanently delete.
  • checkout / restore: Flags uncommitted modifications about to be discarded.
  • rebasing with uncommitted work: Warns of dirty working trees before rebase conflicts occur.
  • pushing to protected branches: Direct pushes to main, master, prod, dev, etc.
  • detached HEAD situations: Warns when working or committing on detached HEADs.

🛠️ Usage & Commands

Command Description
gitpush "Commit message" Stages all changes, previews diffs, commits, and pushes.
gitpush Pushes staged/unpushed changes with safety preview.
gitpush -y Pushes immediately without confirmation prompt.
gitpush --dry-run Shows the pre-push inspection and exits without changes.
gitpush --force Safe force push using --force-with-lease.
gitpush --tags Pushes all local tags.
gitpush guard <git command> Inspects and guards any dangerous Git command.
gitpush --init Initializes Git repo and creates default .gitignore.
gitpush --new-repo <name> Creates a new GitHub repo and pushes in one step.

📄 License

MIT License. See LICENSE for details.

Metadata

Release files for gitpush-tool 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gitpush-tool 0.4.2
File Size Uploaded Provenance Actions
gitpush_tool-0.4.2.tar.gz 31.9 kB Without provenance Details for gitpush_tool-0.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gitpush-tool 0.4.2
File Interpreter ABI Platform Actions
gitpush_tool-0.4.2-py3-none-any.whl Python 3 none any Details for gitpush_tool-0.4.2-py3-none-any.whl

Total release size: 62.2 kB

Release files / gitpush_tool-0.4.2.tar.gz

Download URL gitpush_tool-0.4.2.tar.gz
Size 31.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3abac0dd5ff306547e51a5e67dffc63932ed02e36c73661a9b8e484909e3d4c1
BLAKE2b-256 checksum
How to use checksums
4e70c218ed8d2520fb740a0f3b0b8ef6f12bb4eef10e5512446e533f3b3acda8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / gitpush_tool-0.4.2-py3-none-any.whl

Download URL gitpush_tool-0.4.2-py3-none-any.whl
Size 30.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1d19e03b0bef78194c62a6bd0cb189663f704dbead3f800e8318b71a9a63b01
BLAKE2b-256 checksum
How to use checksums
415ab9008ec9cb70296892979d70001039f6b9c4cdf078ba9945c7685b0b2cd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for gitpush-tool 0.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page