# `! [rejected] main -> main (non-fast-forward) — error: failed to push some refs`

**Where it appears:** Terminal

**What it means:** GitHub has newer commits that aren't on your computer yet, so Git stopped the push to protect you from overwriting them.

## Likely causes

- A pull request was merged on GitHub (or you worked on another computer) since your last pull.
- Pushing directly to `main` instead of pulling first or working on a feature branch.

## Message for your agent

```text
GitHub rejected my push with `non-fast-forward`. Pull the remote changes first, explain any conflict in plain words before resolving it, and push again. Never force-push.
```

**Prevention:** Pull at the start of every session and build each task on its own branch.

---
Source: [Agentic Makers](https://agenticmakers.app/en/help/errors/git-push-rejected-non-fast-forward) · License: CC BY 4.0
