DEV Community

Chidiebere Chukwudi
Chidiebere Chukwudi

Posted on • Edited on • Originally published at jovialcore.tech

heroku: [solved] failed to push some refs

Just a Promotion : Experience reliable hosting with interserver

Solution

I want to assume that you are getting this error message: *error: failed to push some refs*
when you are trying to push your app to the remote git repository on heroku ?

Reason:

It maybe that your github default branch is main and not master or vice versa.

So to solve this problem you will have to use your actual github default branch. In my case, I got the error because my github default branch isn't master but main.

So in my situaton instead of git push heroku master do:

git push heroku main 
Enter fullscreen mode Exit fullscreen mode

Yours could be otherwise:

git push heroku master
Enter fullscreen mode Exit fullscreen mode

But you have to confirm from your github repository

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (6)

Collapse
 
josealz profile image
JoseAlz

En mi caso funciono
git push heroku HEAD:master

Collapse
 
jovialcore profile image
Chidiebere Chukwudi

Contento de que funcionó

Collapse
 
muhammadasif_cse profile image
Muhammad Asif

thank you bro

Collapse
 
maaeyeng profile image
Y.Maae

not work

Collapse
 
priya2022 profile image
Priyadarshini

thanks

Collapse
 
jovialcore profile image
Chidiebere Chukwudi

Glad it helped

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay