Skip to main content

BeforePush

PyPI version Python versions License Tests

BeforePush logo

A lightweight CLI that checks whether your Git branch is ready before pushing or opening a pull request.

Features

  • Check if the current directory is a Git repository
  • Show the current branch
  • Detect uncommitted or untracked changes
  • Check upstream branch configuration
  • Check if the current branch is behind a target branch
  • Support custom target branches
  • Clean terminal output with Rich

Installation

Install BeforePush from PyPI:

pip install before-push

Usage

Run BeforePush inside a Git repository:

beforepush

By default, BeforePush checks your current branch against main.

You can specify a different target branch with --target:

beforepush --target develop

Example

BeforePush example

Checks

BeforePush performs the following checks:

  • Git repository — verifies that the current directory is a Git repository.
  • Current branch — shows the branch currently checked out.
  • Working tree — detects uncommitted or untracked changes.
  • Upstream branch — checks whether the current branch has an upstream branch configured.
  • Target branch — checks whether the current branch is behind the selected target branch.

Development

Clone the repository:

git clone https://github.com/alibro005/beforepush.git
cd beforepush

Install dependencies:

uv sync

Run the tests:

uv run pytest -v

Run the CLI locally:

uv run beforepush

Test against another target branch:

uv run beforepush --target develop

Scope

BeforePush focuses on local Git branch readiness.

It does not create or merge pull requests, authenticate with GitHub, perform code reviews, manage remote repositories, or modify Git history.

License

This project is licensed under the MIT License.

Release files for before-push 0.1.1

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

Source distribution (sdist)

Source distribution for before-push 0.1.1
File Size Uploaded
before_push-0.1.1.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for before-push 0.1.1
File Interpreter ABI Platform
before_push-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.3 kB

Release files / before_push-0.1.1.tar.gz

Download URL before_push-0.1.1.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4fb90aea15d414413246065a00cd61ff9c33aae95e0c2562336140440f386891
BLAKE2b-256 checksum
How to use checksums
fc105be19d50bfcf91a908585350769ea28d6027ead3651533a6cd754038280e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / before_push-0.1.1-py3-none-any.whl

Download URL before_push-0.1.1-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dbc29d6b5f37b2be265f5b0d1aaf604274950af6d098c98e934c6ae7c0c4760a
BLAKE2b-256 checksum
How to use checksums
b44899db63fcf179f807ecbdbb61b23405a28df77a63831ad740a151ddc839a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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