-
-
Notifications
You must be signed in to change notification settings - Fork 954
-
I just want to git pull like git bash
i set rsa with empty password
when i code these
#"D:/work/test_git" it's my local git folder, it's clone from remote repo_path = "D:/work/test_git" repo = git.Repo(repo_path) repo.git.pull()
it always show me
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
cmdline: git pull
stderr: 'Host key verification failed.
fatal: Could not read from remote repository.
these is no useful information in the net
it's too difficult to use, is there any easy way to show developer to use???
maybe you can write a right example code to show how to use.
i use git bash to git pull , it's work fine. these is no problem in git bash with my git ssh
ENV: windows 10
python 2.7.17
gitpython 2.1.15
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 3
GitPython
calls git
in a way that hides the terminal which sometimes leads to authentication issues. Since the password is empty, I'd expect using the private key on the client machine not to be the problem.
Searching for Hist key verification failed
yields this answer which points the finger at the remote host. Probably SSH wants to ask if using this host key is alright, as it apparently isn't known yet, but it can't as there is no Terminal.
You could try to use HTTPS remote URLs instead of the ones using SSH as this bypasses the need for a key entirely. Alternatively, you could use this portion of the docs to configure a custom ssh executable and pass the required ssh flags.
ssh_executable
Replies: 1 comment
-
GitPython
calls git
in a way that hides the terminal which sometimes leads to authentication issues. Since the password is empty, I'd expect using the private key on the client machine not to be the problem.
Searching for Hist key verification failed
yields this answer which points the finger at the remote host. Probably SSH wants to ask if using this host key is alright, as it apparently isn't known yet, but it can't as there is no Terminal.
You could try to use HTTPS remote URLs instead of the ones using SSH as this bypasses the need for a key entirely. Alternatively, you could use this portion of the docs to configure a custom ssh executable and pass the required ssh flags.
ssh_executable = os.path.join(rw_dir, 'my_ssh_executable.sh') with repo.git.custom_environment(GIT_SSH=ssh_executable): repo.remotes.origin.fetch()
The example below sets a key, but can be used to pass any parameters.
#!/bin/sh ID_RSA=/var/lib/openshift/5562b947ecdd5ce939000038/app-deployments/id_rsa exec /usr/bin/ssh -o StrictHostKeyChecking=no -i $ID_RSA "$@"
Beta Was this translation helpful? Give feedback.