2017-03-06 55 views
0

我是新來的Git和Python,我試圖做:「混帳推起源大師」在德威

git push origin master using Dulwich 

我克隆了一個遠程倉庫到本地回購「local_repo」,然後試圖做一些事情像:

porcelain.push(local_repo,'git://github.com/myusername/myrepo') 

,並顯示錯誤:

"dulwich.errors.GitProtocolError: You can't push to git://github.com/myusername/myrepo Use https://github.com/myusername/myrepo.git" 

當我使用:

porcelain.push(local_repo,'https://github.com/myusername/myrepo.git') 

它顯示錯誤:

"dulwich.errors.GitProtocolError: unexpected http response 401" 

請告訴我,我怎麼去了解它

+2

您需要爲請求通過提供適當的身份驗證參數。 '401'代表無效認證。 –

回答

0

你不能推到倉庫,你沒有必要的權限。

git clone https://username:[email protected]/username/repository.git 

我雖然使用GitHub的SSH密鑰:如果你喜歡,你可以通過ceredentials作爲URL的一部分。

編輯:它似乎像瓷器有一個私人存儲庫工作的錯誤。我在這裏打開了一個問題:https://github.com/jelmer/dulwich/issues/507

+0

你能告訴我們如何使用德威公司做到這一點? – Keats