I want make push and get error: src refspec master does not match any

后端 未结 16 1990
梦如初夏
梦如初夏 2020-12-02 12:16

I\'m hosting on Heroku. I want to make a push:

git push master Heroku

I gets the message:

error: src refspec master does no         


        
16条回答
  •  旧巷少年郎
    2020-12-02 12:38

    I experienced the same issue. For me the problem occurred because I hadn't signed into git correctly. Before you can push code to the master branch, you must have first made your initial commit with the command git commit -m "My first commit". You may have gotten this response when trying to do that (like I got):

    git: fatal unable to auto-detect email address (got "some wrong email").

    If that was the response you got, you must now enter your desired git email and username with the commands:

    git config --global user.email "you@example.com"

    git config --global user.name "Your Username"

    After you've done that, try the push command again

    git push heroku master

    It should work now.

提交回复
热议问题