Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork941
Closed
Labels

Description
Environment: GitPython (2.1.7), python 2.7.14, CentOS 6.9, git 2.15.0-rc1
I using this following code to clone:
ssh_key=os.path.join('.',Config.git.ssh_key)ssh_key_command='ssh -i %s'%ssh_keyos.environ['GIT_SSH_COMMAND']='ssh -i ./data/id_rsa'repo=Repo.clone_from(Config.git.source,'wkdir')
It's work, but when I using:
r=Repo('wkdir')withr.git.custom_environment(GIT_SSH_COMMAND='ssh -i ./data/id_rsa'):r.remotes.origin.fetch()
It say that:
Traceback (most recent call last): File "<stdin>", line 2, in <module> File "/usr/local/lib/python2.7/site-packages/git/remote.py", line 779, in fetch res = self._get_fetch_info_from_stderr(proc, progress) File "/usr/local/lib/python2.7/site-packages/git/remote.py", line 665, in _get_fetch_info_from_stderr proc.wait(stderr=stderr_text) File "/usr/local/lib/python2.7/site-packages/git/cmd.py", line 418, in wait raise GitCommandError(self.args, status, errstr)git.exc.GitCommandError: Cmd('git') failed due to: exit code(128) cmdline: git fetch -v origin stderr: 'fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.'
I make sure I have full permission with remote repository, I also trying:
#!/bin/shID_RSA=$PWD/data/hksdexec /usr/bin/ssh -o StrictHostKeyChecking=no -i$ID_RSA"$@"
and
withr.git.custom_environment(GIT_SSH='id_rsa.sh'):r.remotes.origin.fetch()
It's doesn't work, too.