Smart Git cherry-picking between production and homologation branches with rebase-safe commit matching.
# Install
curl -sSf https://raw.githubusercontent.com/carlosarraes/chr/main/install.sh | sh
# Cherry-pick from PRD to HML (default)
chr pick
# Cherry-pick from HML to PRD
chr pick --reverse
# Show what would be picked (dry-run)
chr pick --show- Bidirectional: PRD→HML (default) or HML→PRD (
--reverse) - Rebase-safe: Matches commits by author+date+message, not hash
- Smart filtering: Avoids duplicate picks across rebases
- User-focused:
--latestshows only your commits - Date filtering:
--today,--yesterday, custom ranges
curl -sSf https://raw.githubusercontent.com/carlosarraes/chr/main/install.sh | shDownload from releases or build from source:
git clone https://github.com/carlosarraes/chr && cd chr && make install-localchr expects this naming pattern:
- Current branch: Any branch (e.g.,
feature/login) - Production:
{prefix}{card-number}{suffix_prd}(e.g.,ZUP-123-prd) - Homologation:
{prefix}{card-number}{suffix_hml}(e.g.,ZUP-123-hml)
chr config --set-key prefix --set-value "PROJ-"
chr config --set-key suffix_prd --set-value "-prod"
chr config --set-key suffix_hml --set-value "-stage"- CLI flags:
chr pick --reverse - Environment:
CHR_PREFIX="PROJ-" chr pick - Config file:
~/.config/chr.toml - Defaults:
ZUP-,-prd,-hml
prefix = "ZUP-"
suffix_prd = "-prd"
suffix_hml = "-hml"
color = true# Check today's commits to pick
chr pick --today --show
# Pick them
chr pick --today
# Reverse direction (HML → PRD)
chr pick --reverse --today# Resolve conflicts, then:
chr pick --continue# See what's happening
chr pick --debug --show
# Skip smart filtering
chr pick --no-filter --show| Flag | Description |
|---|---|
--reverse |
Pick HML → PRD instead of PRD → HML |
--show |
Dry-run mode (safe preview) |
--latest |
Only your commits |
--today, --yesterday |
Date filters |
--since DATE, --until DATE |
Custom date range |
--count N |
Limit number of commits |
--continue |
Resume after conflicts |
--debug |
Detailed output |
--no-filter |
Disable smart deduplication |
- Detects card number from current branch
- Determines source/target branches (respects
--reverse) - Finds commits in source not in target
- Matches commits safely using author+date+message (survives rebases)
- Filters by user/date if requested
- Shows or picks commits
- "Branch doesn't match format": Check branch naming convention
- "No commits found": Try
--debug --showto see what's happening - "Branch doesn't exist": Ensure both PRD and HML branches exist
- Cherry-pick conflicts: Resolve manually, then
chr pick --continue
chr pick --debug --show # See detailed process
chr pick --no-filter --show # Skip smart filtering
chr config # Check configurationmake build # Build binary
make test # Run tests
make fmt # Format code
make lint # Lint codeMIT License