hmm - Git Safety Wrapper
A safety wrapper for git push that prevents accidental pushes to origin without a branch name.
What does it do?
Have you ever typed git push origin and immediately regretted it? hmm adds a safety net by requiring 3 explicit confirmations before allowing a push to origin without a branch name.
Before hmm:
$ git push origin
# Oops... pushed to the wrong branch or with unintended behavior
After hmm:
$ git push origin
DANGER: You are pushing to ORIGIN without a branch!
Type 'yes' to confirm [1/3]: yes
WARNING: This may overwrite or break things on origin!
Type 'yes' to confirm [2/3]: yes
FINAL CHECK: Do you really want to do this?
Type 'yes' to confirm [3/3]: no
Push cancelled.
Installation
Method 1: NPM/NPX (Recommended for Node.js users)
# Install globally
npm install -g hmm-git-safety
# Or use npx without installing
npx hmm-git-safety install
Method 2: Python/Pip (Recommended for Python users)
# Install via pip
pip install hmm-git-safety
# Run the installer
hmm install
Method 3: Homebrew (macOS)
# Add the tap (when published)
brew tap yourusername/hmm
brew install hmm
# Or install directly
brew install hmm.rb
Method 4: Direct Shell Script (Universal)
# Download and run installer
curl -fsSL https://raw.githubusercontent.com/yourusername/hmm/main/install.sh | bash
# Or manually
git clone https://github.com/yourusername/hmm.git
cd hmm
chmod +x install.sh
./install.sh
Method 5: GUI Installer (All Platforms)
Download and run the GUI installer:
# Requires Python 3 with tkinter
python3 gui_installer.py
The GUI provides a user-friendly interface for:
- Installing hmm
- Uninstalling hmm
- Checking installation status
- Viewing installation logs
Usage
Once installed, hmm works automatically. Just use git as normal:
# Safe - specifies branch
git push origin main
git push origin feature-branch
# Dangerous - will trigger 3 confirmations
git push origin
Management Commands
# Check installation status
hmm status
# Uninstall hmm
hmm uninstall
# Get help
hmm help
How it Works
hmm adds a bash/zsh function to your shell configuration file (.zshrc, .bashrc, or .profile) that wraps the git command. When you try to run git push origin without a branch name, it intercepts the command and asks for confirmation three times before proceeding.
The wrapper is lightweight and doesn't affect any other git commands.
Supported Platforms
- macOS (zsh, bash)
- Linux (bash, zsh)
- Windows (via WSL or Git Bash)
Uninstallation
# Using the command
hmm uninstall
# Or using the package manager you used to install
npm uninstall -g hmm-git-safety
pip uninstall hmm-git-safety
# Or using the uninstall script
./uninstall.sh
# Or manually remove the "hmm git safety wrapper" block from your shell config
Configuration Files
hmm automatically detects your shell and modifies the appropriate config file:
- zsh:
~/.zshrc - bash:
~/.bashrc - other:
~/.profile
Why "hmm"?
Because when you type git push origin without a branch name, your first thought should be "hmm... is this really what I want to do?"
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - feel free to use this in your own projects!
Roadmap
- Support for more shells (fish, powershell)
- Customizable confirmation count
- Custom warning messages
- Whitelist specific repositories
- Integration with git hooks
Support
If you find this useful, please star the repository and share it with your fellow developers who might benefit from an extra safety net!
Disclaimer
This tool is provided as-is. While it adds a safety layer, always be careful with your git commands and understand what they do before executing them.
Metadata
Release files for hmm-git-safety 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| hmm_git_safety-1.0.0.tar.gz | 4.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hmm_git_safety-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.0 kB
Release files / hmm_git_safety-1.0.0.tar.gz
| Download URL | hmm_git_safety-1.0.0.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
174412c0203ba552f904d1b172abfd7ecf32ca7b4e618f860673483c079d5272
|
|
BLAKE2b-256 checksum How to use checksums |
5258cd252eb89f8bfdbf88bf61c69d32cd869bb79a29fd41eb1a90657d306a57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.4
|
Release files / hmm_git_safety-1.0.0-py3-none-any.whl
| Download URL | hmm_git_safety-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
10c75c69960dca25cf6fe5ca9774deb432fe3e7ebb684b4ecd67d75739d5e1b9
|
|
BLAKE2b-256 checksum How to use checksums |
6a3f8755cd8db23e51f9c3307aaa13f2455480ebf6ad12944030348db66d4c9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.4
|
Security for hmm-git-safety 1.0.0
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.