error: src refspec master does not match any

后端 未结 21 1107
别跟我提以往
别跟我提以往 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:16

    It happened to me and I discovered that github was trying to verify my account. So you need these 2 commands:

    git config --global user.email <your github email>
    git config --global user.name <your github username>
    
    0 讨论(0)
  • 2020-12-22 18:17

    This should help you

    git init
    git add .
    git commit -m 'Initial Commit'
    git push -u origin master
    
    0 讨论(0)
  • 2020-12-22 18:17

    i have same problem, to solve it, follow these steps

     git init
     git add .
     git commit -m 'message'
     git push -u origin master    
    

    after this, if you still having that error, follow these steps again

     git add .
     git commit -m 'message'
     git push -u origin master 
    

    that worked for me and Hope it will help anyone

    0 讨论(0)
  • 2020-12-22 18:17

    By just adding an empty commit will fix issue by using

    $ git commit -m "empty commit" --allow-empty
    $ git push
    

    // above make empty commit without edit then push

    0 讨论(0)
  • 2020-12-22 18:19

    This error is also caused due to an unmatched local branch name. Make sure that you are giving correct local branch name (check spelling and case sensitivity)
    I had the same error because my local branch name was "validated" and was trying to push the changes using git push -f origin validate, updated that to git push -f origin validated worked.

    Hope this helps.

    0 讨论(0)
  • 2020-12-22 18:20

    Only because your local branch does not math the one in your remote repository. git push origin HEAD:master Enable you to ignore the conflict and upload your commit anyway.

    0 讨论(0)
提交回复
热议问题