The clone command works fine .But I need to commit changes and push the changes under this user account.
\nI didn't find any document about how to set env when commit and push the change.
Any suggestion?
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"In the documentation about remotes you will find this:
\nssh_cmd = 'ssh -i id_deployment_key'\nwith repo.git.custom_environment(GIT_SSH_COMMAND=ssh_cmd):\n repo.remotes.origin.fetch()
which applies to pushes as well.
","upvoteCount":1,"url":"https://github.com/gitpython-developers/GitPython/discussions/1257#discussioncomment-795508"}}}-
Hi, I'm trying to write a script and running the script on a linux box. I need to use an user account to connect to the git repo Currently I'm using below command to clone the repo:
The clone command works fine .But I need to commit changes and push the changes under this user account. Any suggestion? |
Beta Was this translation helpful? Give feedback.
-
In the documentation about remotes you will find this: ssh_cmd = 'ssh -i id_deployment_key'
with repo.git.custom_environment(GIT_SSH_COMMAND=ssh_cmd):
repo.remotes.origin.fetch() which applies to pushes as well. |
Beta Was this translation helpful? Give feedback.
In the documentation about remotes you will find this:
which applies to pushes as well.