Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use custom ssh key cannot push/fetch/pull #690

Closed
@ghost

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp