-
is something wrong? i can run the same code on windows but failed on ubuntu! help me tks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
GitPython tries very hard to find a suitable git executable on the system it is executed on, and I could imagine that this for some reason fails. Hope that helps. |
Beta Was this translation helpful? Give feedback.
-
Along with export PATH=$PATH:/usr/bin/git
export GIT_PYTHON_GIT_EXECUTABLE=/usr/bin/git
export GIT_SSH_COMMAND="/usr/bin/ssh -i ~/.ssh/id_rsa" |
Beta Was this translation helpful? Give feedback.
GitPython tries very hard to find a suitable git executable on the system it is executed on, and I could imagine that this for some reason fails.
Before starting your program, or before importing GitPython, you can set the
GIT_PYTHON_GIT_EXECUTABLE
to the executable to use, like inGIT_PYTHON_GIT_EXECUTABLE=/usr/bin/git python myscript.py
. That will force GitPython to use the specified executable, which usually works.Hope that helps.