Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"git push origin master " in Dulwich

I am new to git and python and I was trying to do :

git push origin master using Dulwich

I have cloned a remote repository to local repo "local_repo" and then trying to do something like:

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

like image 709
Keats Avatar asked Apr 24 '26 13:04

Keats


1 Answers

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:

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

I would use an ssh key for github though.

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

like image 112
nir0s Avatar answered Apr 27 '26 03:04

nir0s



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!