PlainError

Home / Coding

git push: error: failed to push some refs (rejected, non-fast-forward)

Last checked 2026-10-17 · 3 fixes · reviewed answer

TL;DRGit refused to upload your local changes because the remote server already has newer commits on the same branch that your copy does not include.

Likely causes

  1. Someone else pushed updates to the same branch after you last fetched or pulled.most likely
  2. You have multiple local clones or machines pushing to the same remote branch.possible
  3. A previous push was interrupted or a force-push occurred on the remote.less likely

How to fix it

Safest first: SafeChanges settingsDangerous
  1. Fetch the latest remote changesSafe

    Download updates from the server without merging them yet so you can see what is new.

    git fetch
  2. Pull and merge the remote changesChanges settings

    Bring the remote commits into your local branch so your push can succeed afterward.

    git pull
  3. Push your changes againChanges settings

    Upload your now-up-to-date local branch to the remote.

    git push

If that didn't fix it

Your local commits will remain unshared and teammates will continue to see only the remote version of the branch.

When to see a technician

If you are unsure how to resolve merge conflicts or are working in a shared repository you do not fully control, ask a colleague or developer familiar with Git.

Did this fix it? Report a problem

Related errors