也許是一個重複的問題,儘管我試圖找出現有問題的答案但失敗。
無法將文件推送到新創建的git倉庫
我創建了一個混帳回購協議在服務器上使用命令:
mkdir gitrepo
cd gitrepo
git init
然後從另一臺機器我試圖文件推送到該回購,但失敗了。
git init
git clone [email protected]:~/gitrepo/.git
cd gitrepo
touch test
git add test
git commit -a
現在使用,沒有錯誤發生。當我嘗試將更改推送到服務器時,發生以下錯誤:
>git push
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to '[email protected]:~/gitrepo/.git'
任何人都遇到過此問題嗎?
我發現了一個博客,可以很好地解釋非裸露和非裸露回購之間的區別。 http://www.bitflop.com/document/111 那些得到同樣問題的人可能會提到這一點。
也許你應該指定一個分支,比如'master'。 – Emily
我試過這個「git push master」,得到了「致命的:'master'似乎不是一個git倉庫。致命:遠程端意外掛斷」。目前我在主分支上 – cheng