Why Git Reports “failed to push some refs”
The “failed to push some refs” error is Git’s way of refusing a git push because your local branch is behind its remote counterpart: the remote has commits you don’t have locally, so Git asks you to integrate those changes first. This post explains why this non-fast-forward rejection occurs and provides three reliable solutions, including fast-forwards, to push your updates to the remote repository.
The Problem - failed to push some refs
So, what does the “failed to push some refs to” error message mean? This error occurs when you try to push your changes to a remote repository, but Git refuses to do so because your local branch is behind the remote branch. Git is telling you that there are changes on the remote branch that you don’t have on your local branch, and it wants you to update your local branch first before pushing your changes.
This error message can be frustrating, especially when you’re confident your changes will be OK with the remote branch. However, Git has a good reason for preventing you from pushing your changes - it wants to ensure that all changes are merged correctly and that no conflicts arise.
That issue occurred after I was away from my big MAC computer and did some repository updates using my laptop. When arriving back, I could not push an update from my big MAC computer. Git updates were rejected because my current branch is behind. That happens quite often when we should integrate the remote changes before pushing git updates. Herein I am sharing possible solutions in detail.
The outcome was not nice:
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:user/repo'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
How to Fix the “failed to push some refs” Error in Git
🔒 Subscribe to keep reading.
Conclusion: Resolving the “failed to push some refs” Error
🔒 Subscribe to keep reading.
References
🔒 Subscribe to keep reading.
You've hit a Deep Dive tutorial.
I spend dozens of hours researching, coding, and breaking things to write these guides. This content is free, but reserved for my subscriber community. Drop your email below to unlock this guide (and all past/future deep dives):
Full content temporarily unavailable — refresh in a moment
Already a subscriber? Use the magic link from your last newsletter, or reset your password.
Log in to unlock
New subscribers get an inbox mail: Set a password to unlock articles. The form does not log you in — use the same email afterwards.