2012-04-13 31 views
6

爲什麼我的混帳取得與一個失敗的:從上游的github倉庫抓取失敗時掛斷

fatal: The remote end hung up unexpectedly 

我是一個私人項目的合作者,並已成功分叉項目。我已經建立了遠程使用GitHub的例子:

git remote add upstream git://github.com/{upstream owner}/{upstream project}.git 

我可以看到使用「混帳-v顯示-n上游」

Fetch URL: git://github.com/{upstream owner}/{upstream project}.git 
Push URL: git://github.com/{upstream owner}/{upstream project}.git 

我知道我的SSH密鑰作品加入遠程:

ssh -T [email protected] 
Hi miketempleman! You've successfully authenticated, but GitHub does not provide shell access. 

然而,當我試圖從上游資源庫更新我的本地庫:

[email protected]:~/{directory}$ git fetch upstream 
fatal: The remote end hung up unexpectedly 

對於這樣一個愚蠢的問題道歉。

+0

已推到上游回購曾經有效?您確定上游所有者已爲您的用戶帳戶設置適當的權限嗎? – cfedermann 2012-04-13 20:15:27

+0

我只是試圖用上游更改更新我的本地存儲庫。換句話說,讀取訪問更多。但它是一個簡單的存儲庫,所以我讀過的文檔表明我有讀/寫訪問權限。 – 2012-04-13 20:41:49

回答

11

我認爲git://只讀URI不可用於私人回購,因此它們不是世界可讀的(即,如果您被授權,您只能在回購站購買)。

嘗試使用不同的遠程URI:

git remote set-url upstream [email protected]:{upstream owner}/{upstream project}.git 

,或者可選地與HTTPS:

git remote set-url upstream https://{your username}@github.com/{upstream owner}/{upstream project}.git 
+0

這樣做。所以希望其他人試圖在git上使用私有存儲庫進行共享開發將會找到你的鏈接! – 2012-04-13 22:01:04

+0

很高興它爲你工作。請您將答案標記爲已接受? :) – 2012-04-14 07:24:17

+0

哎呀,對不起 – 2012-04-15 17:03:07