問題:
I just started using git with github.我剛開始在 github 上使用 git。 I followed their instructions and ran into errors on the last step.我按照他們的指示,在最後一步遇到了錯誤。 I'm checking in an existing directory that isn't currently source-controlled (project about a week old).我正在檢查當前不受源代碼控制的現有目錄(大約一週前的項目)。 Other than that, my use case should be pretty run of the mill.除此之外,我的用例應該是完全正常的。
Here's what's happening:這是發生了什麼:
$ git push origin master
error: src refspec master does not match any.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to '[email protected]:{username}/{projectname}.git'
Github's instructions: Github 的說明:
Global setup:
Download and install Git
git config --global user.name "Your Name"
git config --global user.email {username}@gmail.com
Next steps:
mkdir projectname
cd projectname
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin [email protected]:{username}/{projectname}.git
git push origin master
解決方案:
參考一: https://en.stackoom.com/question/3TEN參考二: https://stackoom.com/question/3TEN