Heroku Git Push Rejected / Remote Rejected
Quick answer
Most failed pushes are branch or repo problems, not build errors: pushing master when Heroku expects main, a missing remote, or a repo that is too big. Check the exact message after 'remote:'.
Most likely fix: Push the right branch
How to fix it
Try these in order — the most common fix is first.
1. Push the right branch
- Heroku only deploys the main or master branch of the remote
- From another branch: git push heroku mybranch:main
- Local master: git push heroku master:main
Did this fix it?2. Check the remote
- git remote -v should list heroku
- If not: heroku git:remote -a <app>
Did this fix it?3. Log in again
- Run heroku login
- Do not use your account password with Git over HTTPS
Did this fix it?4. Deploy from the app root
- The app must be in the repository root; a subfolder app will not run
- Commit the manifest (package.json, requirements.txt, Gemfile) so a buildpack is detected
Did this fix it?5. Shrink a huge repo
- Repos above ~600 MB cause slow or failed pushes
- Remove committed binaries or logs; Git LFS is not supported
Did this fix it?6. Wait out rate limits
- 'Too many requests for this Git repo' means 75 requests per hour: stop scripts that poll and wait
Did this fix it?
Symptoms
git push heroku main shows 'src refspec main does not match any', 'remote rejected', 'Everything up-to-date' with no deploy, or an authentication warning.
Why it happens
- Local branch is master, not main
- Pushing a non-main branch (it has no effect on Heroku)
- No heroku git remote
- App lives in a repo subdirectory
- Password auth instead of heroku login
- Repo too large or Git LFS used
This guide also covers
- heroku push rejected
- heroku remote rejected
- heroku git push error
- heroku src refspec main does not match
Still not working?
If Heroku keeps failing, you're not alone. See every Heroku problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to us