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

Git().custom_environment(GIT_SSH_COMMAND=git_ssh_cmd) issue #916

Closed
@CaptainJL

Description

@CaptainJL

Hey all,

I am having an issue with using the custom_environment parameter.
This is on a Windows 10 machine.

Basically this will not work, returning the error (see under code)

import gitfrom git import Repofrom git import Gitgit_ssh_cmd = 'ssh -i gpt_key'with Git().custom_environment(GIT_SSH_COMMAND=git_ssh_cmd):     Repo.clone_from('git@bitbucket.org:<private git>.git', 'python_test_cloning')

git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

However setting the env variable in the Repo.clone_from command works fine:
Repo.clone_from('git@bitbucket.org:<private git>.git', 'python_test_cloning', env={"GIT_SSH_COMMAND": 'ssh -i gpt_key'})

I need to be able to use the ssh key for operation other than cloning, so I need to be able to set up the local environment purely via the python interface. This also fails for reference (when I did sucessfully clone).

repo = git.Repo("python_test_cloning")with repo.git.custom_environment(GIT_SSH_COMMAND='ssh -i gpt_key'):    for remote in repo.remotes:        remote.fetch()

with error:

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 rights
and the repository exists.'

Any ideas of why this is not working and how to fix it?
Remember that this is Windows 10.

Thanks,
CaptainJL

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