What problem does it solve?
Prevents broken or unsafe automation when running git commands by ensuring scripts check the right state (current branch, upstream availability, dirty/unstaged changes) instead of producing false positives or pushing unintentionally.
Core Features & Use Cases
- Safe push gating: Uses commit-ahead checks against the current branch’s upstream to decide whether a push should happen.
- Repository-state detection: Detects uncommitted changes, untracked files, detached HEAD, and whether a directory is a git repository (including worktrees).
- Makefile correctness: Applies Makefile-specific practices like escaping dollar signs and using proper phony targets to avoid subtle shell/variable bugs.
- Use Case: You want a Makefile target that scans multiple repo folders, pushes only those with commits ahead of upstream, and prints helpful branch/ahead information without spamming errors.
Quick Start
Ask for git-scripting guidance to write a Makefile target that pushes only the current branch when it is ahead of its upstream and skips repos that are missing upstream or have no git checkout.