A lightweight CLI that checks whether your Git branch is ready before pushing or opening a pull request.
- 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
- Show repository and Git-state diagnostics with
--verboseor-v - Run checks automatically before git push with a pre-push hook
- Support custom target branches
- Warn about newly staged files larger than 5 MB (configurable)
- Clean terminal output with Rich
Install BeforePush from PyPI:
pip install before-pushRun BeforePush inside a Git repository:
beforepushTo specify a different target branch:
beforepush --target developFor detailed usage, including the --max-file-size option and Git pre-push hook instructions, see the documentation.
Contributions are welcome! See CONTRIBUTING.md for development setup, testing, and contribution guidelines.
Thanks to everyone who contributes to BeforePush! ❤️
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.
This project is licensed under the MIT License.
