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.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 before-push 0.1.2
File Size Uploaded
before_push-0.1.2.tar.gz 6.8 kB Details

Built distribution (wheel)

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

Total release size: 13.4 kB

Release files / before_push-0.1.2.tar.gz

Download URL before_push-0.1.2.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a83f0bacbe526dcdcac907e5cf339a683db3d1a77d4bfc57230f04fbd86fd503
BLAKE2b-256 checksum
How to use checksums
bea622efd62ea5c4c84c271534ba49e254cb48360c7d27303fe3da9373a23e92
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.2-py3-none-any.whl

Download URL before_push-0.1.2-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2c23588d0ce1cdb6e77db1b0dd8f320b3d4dad48ecb3e7bc604a56cfe89f273
BLAKE2b-256 checksum
How to use checksums
72e10ce303969580314d4c9b6a6ba93bc1d17cb7fa661234890a7324e86a0ece
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

This release

0.1.2 This release

2 release files

0.1.1

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