简体   繁体   English

德威的“ git push origin master”

[英]“git push origin master ” in Dulwich

I am new to git and python and I was trying to do : 我是git和python的新手,我正在尝试这样做:

git push origin master using Dulwich

I have cloned a remote repository to local repo "local_repo" and then trying to do something like: 我已经将远程存储库克隆到本地存储库“ local_repo”,然后尝试执行以下操作:

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

and it shows error: 它显示错误:

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

When I use : 当我使用时:

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

It shows error: 它显示错误:

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

Please tell me how do I go about it 请告诉我我该怎么做

You can't push to that repository as you don't have the necessary permissions. 您没有必要的权限,因此无法推送到该存储库。 You can pass the ceredentials as part of the URL if you like: 如果愿意,您可以将证书作为URL的一部分传递:

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

I would use an ssh key for github though. 我会为github使用ssh键。

EDIT: It seems like porcelain has a bug working with private repositories. 编辑:似乎瓷器有一个与私有存储库一起工作的错误。 I've opened an issue here: https://github.com/jelmer/dulwich/issues/507 我在这里打开了一个问题: https : //github.com/jelmer/dulwich/issues/507

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM