error: src refspec master does not match any

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

    For a new repository, the method works for me:

    1. Remote the files related with git
      rm -rf .git

    2. Do the commit again
      git add . && git commit -m "your commit"

    3. Add the git URL and try to push again
      git remote add origin

    4. And then try to push again
      git push -u origin master -f

    5. Success!

    Since it's a new repository, so it doesn't matter for me to remove the git and add it again.

提交回复
热议问题