is something wrong? i can run the same code on windows but failed on ubuntu!
\nhelp me tks
","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"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.
\nBefore starting your program, or before importing GitPython, you can set the GIT_PYTHON_GIT_EXECUTABLE
to the executable to use, like in GIT_PYTHON_GIT_EXECUTABLE=/usr/bin/git python myscript.py
. That will force GitPython to use the specified executable, which usually works.
Hope that helps.
","upvoteCount":1,"url":"https://github.com/gitpython-developers/GitPython/discussions/1151#discussioncomment-408803"}}}-
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.
-
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.