# ! [rejected]        main -> main (non-fast-forward)

- **ID:** `git/push-rejected-non-fast-forward`
- **Domain:** git
- **Category:** protocol_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

Local branch is behind the remote branch and cannot be fast-forwarded; Git refuses to overwrite remote commits without force push.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| git 2.20 | active | — | — |
| git 2.30 | active | — | — |
| git 2.45 | active | — | — |

## Workarounds

1. **Pull the latest remote changes and merge or rebase: git pull origin main --rebase** (90% success)
   ```
   Pull the latest remote changes and merge or rebase: git pull origin main --rebase
   ```
2. **If you are sure you want to overwrite remote history, use force push with lease: git push --force-with-lease origin main** (80% success)
   ```
   If you are sure you want to overwrite remote history, use force push with lease: git push --force-with-lease origin main
   ```

## Dead Ends

- **** — Force push can overwrite remote commits, potentially losing work from other contributors; it should be used with caution. (60% fail)
- **** — The error is about commit history divergence, not connectivity; retrying won't change the history mismatch. (95% fail)
