Common causes
- Another developer pushed to the same branch after you last pulled
- You rebased locally and your history diverged from the remote
- CI or a bot made a commit to the branch on the remote
- You're pushing from a different machine that doesn't have the latest commits
How to fix it
- Pull the latest changes and integrate: git pull --rebase origin <branch>
- Or merge: git pull origin <branch>, then push again
- Use --force-with-lease as a safer force push (won't overwrite others' work): git push --force-with-lease
- Never use --force on shared branches like main — it will overwrite others' work
Example
error: failed to push some refs to 'origin'
hint: Updates were rejected because the tip of your current branch is behind its remote counterpart.Pushing after another team member committed to the same branch
Have a different error?
Paste any error message into the Error Translator to get an instant explanation.
