Message 'src refspec master does not match any' when pushing commits in Git

前端 未结 30 1748
轮回少年
轮回少年 2020-11-22 02:49

I clone my repository with:

git clone ssh://xxxxx/xx.git 

But after I change some files and add and commit them,

30条回答
  •  借酒劲吻你
    2020-11-22 03:06

    I also followed GitHub's directions as follows below, but I still faced this same error as mentioned by the OP:

    git init
    git add .
    git commit -m "message"
    git remote add origin "github.com/your_repo.git"
    git push -u origin master
    

    For me, and I hope this helps some, I was pushing a large file (1.58 GB on disk) on my MacOS. While copy pasting the suggested line of codes above, I was not waiting for my processor to actually finish the add . process. So When I typed git commit -m "message" it basically did not reference any files and has not completed whatever it needs to do to successfully commit my code to GitHub.

    The proof of this is when I typed git status usually I get green fonts for the files added. But everything was red. As if it was not added at all.

    So I redid the steps. I typed git add . and waited for the files to finish being added. Then I followed through the next steps.

提交回复
热议问题