AI-Powered Git Rebase & Merge Conflict Resolver
GitNudge is a free, open-source CLI that resolves git rebase and merge conflicts with Claude AI — analyze conflict risk, auto-resolve conflicts, and rebase safely from your terminal.
gitnudge recover shows the exact undo command.<<<<<<< / ======= / >>>>>>> markers.gitnudge status shows commit X/Y and the subject of the commit currently being applied.gitnudge explain asks Claude to describe a conflict in plain English — no resolution, just understanding.rebase --auto records every AI fix (file, confidence, change summary) so you can review what Claude actually changed.gitnudge analyze detects fast-forward, already-up-to-date, and unrelated-history cases — and surfaces conflict risk before you rebase.📦 Installation
From GitHub
# Install directly from GitHub
pip install git+https://github.com/GitNudge/gitnudge.git
# Install a specific version
pip install git+https://github.com/GitNudge/gitnudge.git@v0.3.1
From Source
git clone https://github.com/GitNudge/gitnudge.git
cd gitnudge
pip install -e .
🚀 Quick Start
1. Set your API key
export ANTHROPIC_API_KEY="your-api-key"
# Or use the config command
gitnudge config --set-key
2. Start rebasing with AI
# Analyze potential conflicts first
gitnudge analyze main
# Rebase with AI assistance (writes a recovery snapshot)
gitnudge rebase main
# Get AI help when conflicts occur
gitnudge resolve
# Or just get a plain-language explanation
gitnudge explain
# Continue, skip, or abort like normal git
gitnudge continue
gitnudge skip
gitnudge abort
# Lost? Show how to undo the rebase
gitnudge recover
📖 Commands
gitnudge rebase <target>
Pre-flight check, snapshot HEAD, then rebase onto target
gitnudge analyze <target>
Analyze conflicts; detects fast-forward / up-to-date / unrelated history
gitnudge resolve [file]
AI-assisted conflict resolution (one file, all files, or auto)
gitnudge explain [file]
Plain-language explanation of a conflict without proposing a fix
gitnudge continue
Continue rebase; reports applied/remaining commit counts
gitnudge skip
Skip the current commit (git rebase --skip)
gitnudge abort
Abort and clear the recovery snapshot
gitnudge recover
Print the saved pre-rebase SHA and the exact git reset --hard command
gitnudge status
Branch, rebase state, live progress, conflicted files, safety SHA
gitnudge config
Show, set API key, set model, or reset configuration
Common Options
gitnudge rebase main --dry-run # Preview without changes
gitnudge rebase main --auto # Auto-apply high/medium-confidence AI fixes
gitnudge rebase main --force # Skip pre-flight checks (NOT recommended)
gitnudge rebase -i HEAD~5 # Interactive rebase
gitnudge resolve --all # Walk through every conflicted file
gitnudge resolve --auto # Auto-apply suggestions without confirmation
gitnudge continue --ai-verify # Refuse to continue if any staged file still has markers
gitnudge analyze --detailed main # Detailed AI risk analysis
gitnudge -v rebase main # Global --verbose / -v (or --quiet / -q)
⚙️ Configuration
GitNudge can be configured via environment variables or a config file at ~/.config/gitnudge/config.toml (saved with 0o600 permissions). All values are validated with pydantic.
Environment Variables
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY |
Your Anthropic API key (required) |
GITNUDGE_MODEL |
Claude model to use (default: claude-sonnet-4-20250514) |
GITNUDGE_CONFIG |
Path to config file (default: ~/.config/gitnudge/config.toml) |
GITNUDGE_NO_COLOR |
Disable colored output |
NO_COLOR |
Standard no-color flag (also disables colored output) |
GITNUDGE_LOG_LEVEL |
Log level: DEBUG, INFO, WARNING, ERROR (default: WARNING) |
Config File Example
# ~/.config/gitnudge/config.toml
[api]
model = "claude-sonnet-4-20250514"
max_tokens = 4096
[behavior]
auto_stage = true
show_previews = true
max_context_lines = 500
auto_resolve = false
[ui]
color = true
verbosity = "normal"
❓ Frequently Asked Questions
What is GitNudge?
GitNudge is a free, open-source command-line tool that helps you perform git rebases and resolve merge conflicts using Claude AI. It analyzes conflicts, suggests intelligent resolutions, and protects your work with pre-flight safety checks and automatic recovery snapshots.
How does GitNudge resolve merge conflicts?
GitNudge sends the conflicting code regions to Claude AI, which proposes a resolution based on the surrounding code and intent. It refuses to apply any output that still contains <<<<<<< / ======= / >>>>>>> conflict markers, and records every auto-applied fix in an audit log so you can review what changed.
Is GitNudge safe to use on my repository?
Yes. GitNudge refuses to start on a dirty working tree or detached HEAD, saves your pre-rebase HEAD automatically, and gitnudge recover prints the exact command to undo a rebase. Configuration is validated with pydantic and API keys are redacted from logs.
Is GitNudge free and open source?
Yes. GitNudge is open source under the MIT License and free to use. You only need your own Anthropic API key to access the Claude AI features.
How do I install GitNudge?
Install it with pip directly from GitHub: pip install git+https://github.com/GitNudge/gitnudge.git. Then set your ANTHROPIC_API_KEY and run gitnudge rebase main. See the installation section for more options.
Questions? Reach out at info@gitnudge.ai