3

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

Yaman Jain
  • 1,254
  • 11
  • 16
Keats
  • 53
  • 3
  • 2
    You need to provide the appropriate authentication parameters for the request to go through. The `401` stands for invalid authentication. – shad0w_wa1k3r Mar 06 '17 at 11:07

1 Answers1

1

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:password@github.com/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

nir0s
  • 1,151
  • 7
  • 17