git push rejected (non-fast-forward)? Pull first, then push
Ship ItChecked against the official source
Source checked 8 Nov 2026 · Published 9 Nov 2026 · Last reviewed 9 Nov 2026 · By Ctrl+Z Therapy (how we test)
The short answer
GitHub's docs: sometimes Git can't make your change to a remote repository without losing commits. When this happens, your push is refused. It usually means someone or something else, such as an AI builder's sync, pushed to the same branch first. Fetch and merge the remote changes with yours, or use git pull to do both at once, then push again.
What to do
- Run git pull origin YOUR_BRANCH_NAME to fetch and merge the remote changes.
- If the same lines changed on both sides, resolve the conflict.
- Push again.
Good to know
- Our tip: don't use git push --force just to make the error go away. It can overwrite the commits that were pushed before yours.
Source
Checked on 8 Nov 2026. Prices, limits and settings change, so check the source before you rely on them.