# hint: (e.g., 'git pull ...') before pushing again.

- **ID:** `git/diverged-branches-fast-forward-rejected`
- **Domain:** git
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

Local branch has diverged from remote branch, so fast-forward push is rejected; user needs to integrate remote changes first.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| git 2.30 | active | — | — |
| git 2.35 | active | — | — |
| git 2.40 | active | — | — |

## Workarounds

1. **Run 'git pull origin main --ff-only' to fast-forward if possible, then retry push** (80% success)
   ```
   Run 'git pull origin main --ff-only' to fast-forward if possible, then retry push
   ```
2. **Run 'git pull origin main --rebase' to rebase local commits on top of remote, then push** (90% success)
   ```
   Run 'git pull origin main --rebase' to rebase local commits on top of remote, then push
   ```
3. **If divergence is intentional, use 'git push --force-with-lease' to safely override remote** (85% success)
   ```
   If divergence is intentional, use 'git push --force-with-lease' to safely override remote
   ```

## Dead Ends

- **Run git pull --rebase without checking for conflicts** — If conflicts exist, rebase will abort or create messy history; also may lose merge commits. (50% fail)
- **Use git push --force to override remote** — Dangerous on shared branches; may delete others' commits and cause data loss. (80% fail)
- **Ignore the hint and retry push without pulling** — Same error will occur because local is still behind remote. (100% fail)
