2013-01-21 53 views
6

任何幫助都會很棒。提前致謝!git push origin master失敗並給出錯誤:src refspec HEAD不匹配任何

我有git安裝和ssh密鑰設置,但我得到這個奇怪的錯誤。

[email protected]:~/Desktop$ cd exercise/ 
[email protected]:~/Desktop/exercise$ git init 
Initialized empty Git repository in /Users/admin/Desktop/exercise/.git/ 
[email protected]:~/Desktop/exercise$ git remote add origin [email protected]:pavankat/exercise.git 
[email protected]:~/Desktop/exercise$ git push origin master 
error: src refspec master does not match any. 
error: failed to push some refs to '[email protected]:pavankat/exercise.git' 
[email protected]:~/Desktop/exercise$ git push [email protected]:pavankat/exercise.git HEAD:test 
fatal: remote part of refspec is not a valid name in/
[email protected]:~/Desktop/exercise$ git push [email protected]:pavankat/exercise.git HEAD:test 
error: src refspec HEAD does not match any. 
error: failed to push some refs to '[email protected]:pavankat/exercise.git' 
[email protected]:~/Desktop/exercise$ 
+0

你想通過推送一個空的存儲庫到github完成什麼​​? –

回答

13

,所以我沒有做

git add . 

git commit -am 'initial commit' 

我推前。

:/

+1

+1我在搜索這個新錯誤時已經第二次搜索這個錯誤了,總是忘記了強制性的'git commit -m'initial commit「'。 – ojdo

相關問題