0

I am trying to clone private repository using Python. I am using Git Python package to clone the repository but I am getting an error:

Error : GitCommandError: 'git clone -v https://github.mit.edu/mitx/content-mit-1690rgit edxcourse' returned exit status 128: Cloning into 'edxcourse'... remote Repository not found. fatal : Authentication failed for 'https://github.mit.edu/mitx/content-mit-1690.r.git/'

However I am a member of this repository and I have access to the repository.

halfer
  • 19,824
  • 17
  • 99
  • 186
farha
  • 13
  • 5

3 Answers3

0

In your case, gitpython merely returns an error it received from the git executable it envoked.

If you call git clone -v https://github.mit.edu/mitx/content-mit-1690rgit on the commandline, you will receive a similar error, indicating something might be wrong with your URL. Possibly it is the rgit extension, which might be a typo.

Byron
  • 3,908
  • 3
  • 26
  • 35
0

Maybe one of the devs can confirm this as I have only been playing around with Git-Python for the last few hours.

When cloning over http(s) it seems to rely on the .netrc file rather than asking for auth like the Git CLI client would.

cat > ${HOME}/.netrc < EOF
machine github.mit.edu
login <username>
password <password>
EOF

chmod 600 ${HOME}/.netrc

If you're on Windows, that works via Cygwin too.

chriscowley
  • 330
  • 2
  • 10
0

The repository which I was trying to Clone is a secured repo. So I need to establish a secure ssh authentication connection. and then it worked for me.

farha
  • 13
  • 5