"git push origin master " in Dulwich

3

我是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表示身份验证无效。 - shad0w_wa1k3r
1个回答

1

由于您没有必要的权限,因此无法向该存储库推送。如果愿意,您可以将凭据作为URL的一部分传递:

git clone https://username:password@github.com/username/repository.git

我会在github上使用ssh密钥。编辑:似乎porcelain在处理私有存储库时存在错误。我在这里打开了一个问题:https://github.com/jelmer/dulwich/issues/507

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接