2017-07-03 113 views
1

我有兩個單獨的問題,解決他們中的任何一個對我來說都是巨大的幫助。我試圖推動我對git repo所做的一些更改,但似乎無法完成兩項工作。推送到Github的問題(HTTP/SSH)

我試圖做到這一點的第一種方式是通過使用我一直在做的到現在爲止的命令:

git push 

但這將打通提交掛了大約30%的方式。在我在網上找到的一些帖子後,我確信自己這是HTTP連接的問題。我試着使用:

git push --verbose --progress 

,它總是卡在

Pushing to https://github.com/my-account/my-repo.git 
Counting objects: 87, done. 
Delta compression using up to 4 threads. 
Compressing objects: 100% (66/66), done. 
POST git-receive-pack (chunked)476.45 MiB | 29.64 MiB/s 

有什麼大的文件,所以我不知道什麼是掛斷。 尋找一些StackOverflow的網頁後,我嘗試使用:

git config http.postBuffer 524288000 

這是(我認爲)應該從分塊數據緩衝,並允許更大的文件要經過阻止它,但我沒有改變。 然後我嘗試更新我的git版本(它在2.10.something,現在是2.13.1),但是這並沒有改變任何東西。

有人建議使用SSH,但我似乎無法讓我的SSH密鑰工作。我試着使用:

git push -v ssh://[email protected]/my-repo.git 

,但我總是得到錯誤:

Pushing to ssh://[email protected]/my-repo.git 
Permission denied (publickey). 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 
and the repository exists. 

所以我費了九牛二虎之力試圖讓這件事的工作,只要再生我的鑰匙,並重新註冊它甚至會與我的帳戶,確保編輯配置,以確保它的工作。這是驗證;命令

ssh -T [email protected] 

返回

Hi my-account! You've successfully authenticated, but GitHub does not provide shell access. 

,但是,當然,

git push -v ssh://[email protected]/my-repo.git 

返回相同的錯誤之前,權限被拒絕。有關如何解決SSH驗證問題或HTTP緩衝問題的想法?

+0

通常(公鑰)意味着你沒有添加一個私人的RSA密鑰到你的github賬戶或各自的回購。這個回購是私人的嗎? –

+0

是的,回購是私人的。儘管我已經將我的密鑰添加到了我的github帳戶,除非我設法做錯了。 它有我的id_rsa指紋保存在SSH密鑰下。 –

+0

通常情況下,您會推送到分支名稱。你有沒有試過指定一個分支? –

回答

0

Github使用單個用戶ssh,並且用戶的名稱是路徑的一部分,例如[email protected]:my-account/repo.git

+0

我得到這個錯誤。推送到ssh://[email protected]:my-account/my_repo。git ssh:連接到主機github.com:my-account端口22:操作超時 致命:無法從遠程存儲庫讀取。 請確保您擁有正確的訪問權限 並存在存儲庫。 –

+0

我提供的URL沒有'ssh://'(這是隱含的,並且語法不同) – Jakuje

+0

取消ssh://沒有區別,它給出了相同的錯誤 –