Skip to content
\n

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.

\n

Any suggestion?

","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

In the documentation about remotes you will find this:

\n
ssh_cmd = 'ssh -i id_deployment_key'\nwith repo.git.custom_environment(GIT_SSH_COMMAND=ssh_cmd):\n    repo.remotes.origin.fetch()
\n

which applies to pushes as well.

","upvoteCount":1,"url":"https://github.com/gitpython-developers/GitPython/discussions/1257#discussioncomment-795508"}}}

How can I commit and push the commit under another user's name? #1257

Answered by Byron
scriptxyz asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Byron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants