git push Heroku main - error: src refspec main does not match any
Asked Answered
D

2

7

I am just trying to follow the step from heroku site. but on my console when i git push to heroku main? that doesn't work.

Some error showing. like below.

C:\Users\TORU\Desktop\Website Again\Python\django_files\hero\hero_con>git push heroku main
error: src refspec main does not match any
error: failed to push some refs to 'https://git.heroku.com/secure-taiga-84539.git'

what i do now??

Dispatch answered 25/9, 2020 at 7:0 Comment(0)
C
6

The default branch is normally called master, not main. So, normally git push heroku master works.

Your error src refspec main does not match any seems to indicate that the branch main does not exist.

Are you sure that your branch is called main?

Carlyn answered 25/9, 2020 at 10:41 Comment(4)
I changed the branch. then it worked and i got another error now. Thanks for Your Answer.Dispatch
For me: master doesn't work. main doesn't work. There were no instructions to create a branch. How would I know what my branch is called?Dasyure
@AlanBaljeu the command git branch shows you all the existing branches, and it also marks the currently active branch with an asterisk (*)Carlyn
Thank you Ralf. It says I have no branches.Dasyure
A
0

If you had already initialized your app and committed/staged the changes on your files, you probably need to run this command heroku git:remote -a yourapp. Here your app will be the heroku app created like enigmatic-brook-14304 or any name the heroku gave your app after running this command heroku create. From there you will be required to git push heroku to master. You might have to run `git branch just to be sure on which branch are you currently operating from.

Agamemnon answered 10/7, 2022 at 21:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.