error: src refspec master does not match any

后端 未结 21 1263
别跟我提以往
别跟我提以往 2020-12-22 17:38

I have tried to follow the solutions suggested in this post but it didnt work and I am still getting: src refspec master does not match any.

Here is what I did: Fo

21条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-22 18:11

    Try following command:

    git push origin HEAD:master
    

    Git threw the below error when I tried simply git push. So clearly this is because Git matches the local and remote branch while pushing commits. This is the push.default behavior, you can find out more details here.

    fatal: The upstream branch of your current branch does not match
    the name of your current branch.  To push to the upstream branch
    on the remote, use
    
        git push origin HEAD:
    
    To push to the branch of the same name on the remote, use
    
        git push origin 
    
    To choose either option permanently, see push.default in 'git help config'.
    

提交回复
热议问题