-
-
Notifications
You must be signed in to change notification settings - Fork 933
Use custom ssh key cannot push/fetch/pull #690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Setting GIT_PYTHON_TRACE=full in the environment may shed some light on this. See http://gitpython.readthedocs.io/en/stable/tutorial.html#git-command-debugging-and-customization |
It's say that:
|
* Abandon gitpython library ssh keymanagement gitpython-developers/GitPython#690 (still nobody answer) * Fix typo in Encrypt.py * Add doc folder * Add some log function
Are you sure the key in question does not have a passphrase? |
Yes, no passphrase |
I think something that could shed light on the issue is if the script instead executes |
Sorry for the late reply, I think I found the problem. r = Repo('test')
with r.git.custom_environment(GIT_SSH_COMMAND='ssh -v -i ./key'):
r.remotes.origin.fetch() Output:
So, I think that: maybe is working directory error, but ssh wasn't show key file not found. I change key path from relative path to absolute path, and it's worked. Fixed coder = Repo('test')
with r.git.custom_environment(GIT_SSH_COMMAND='ssh -v -i /root/key'):
r.remotes.origin.fetch() Output:
So, maybe this bug cause by wrong working directory. |
Thanks for the update! |
But I don't think absolute path is a good idea. Sometimes key file may be in a project directory, sometimes maybe we will move directory to another path. Well, then it is time to change the absolute path. This is why I want to use relative paths. |
I believe the current working directory of the git program invocations is the |
* Following gitpython-developers/GitPython#690 , change ssh key path from relative to absolute path
Environment: GitPython (2.1.7), python 2.7.14, CentOS 6.9, git 2.15.0-rc1
I using this following code to clone:
It's work, but when I using:
It say that:
I make sure I have full permission with remote repository, I also trying:
and
It's doesn't work, too.
The text was updated successfully, but these errors were encountered: