I am using gitpython
library to execute git commands from a python script.
When I execute git pull, it fails giving the following error:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
.
However, git pull runs successfully when I run it directly from shell.
Added to this, other git commands such as git status
, git log
, are all working fine. ONLY git pull/push gives the above error.
This is the python script:
import os
import git
g = git.cmd.Git(local_repo_path)
os.chdir(local_repo_path)
g.checkout('master') // this works fine
msg = g.pull()
print msg // gives an error mentioned below
Output is:
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
cmdline: git pull
stderr: 'Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.'
What could be the possible reason ?