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.3

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.3
File Size Uploaded
before_push-0.1.3.tar.gz 6.8 kB Details

Built distribution (wheel)

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

Total release size: 13.4 kB

Release files / before_push-0.1.3.tar.gz

Download URL before_push-0.1.3.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1afe1afc9c86b15e5ed00d564ed4b797c4370c646c557a50789868f7ba7a588b
BLAKE2b-256 checksum
How to use checksums
fd25bb9072455827de59e9ac0bc73d915a2a28ac5b2bb24867e4ec43383089d0
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.3-py3-none-any.whl

Download URL before_push-0.1.3-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5b2f0ed863ebac976c6528ab9b1c08653bfda3273c20d3f7bdc62dc3cdce78a
BLAKE2b-256 checksum
How to use checksums
565f1dec9f333053b1cd7ed590e8c626c374607a022423a9a11eca6c2e918d30
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

This release

0.1.3 This release

2 release files

0.1.2

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