but it's had no effect - the commits always are pushed under my main GiitHub account, no matter what SSH key I use.
","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"@jmkd3v wrote
\n\n","upvoteCount":2,"url":"https://github.com/gitpython-developers/GitPython/discussions/1203#discussioncomment-495443"}}}Update: I was able to solve this problem by deleting my GitHub credentials and then changing my email and username on the local level.
\n
-
I have a local repository that I've already cloned and I want to push changes to remote (GitHub) from a different account. id_file = os.path.expanduser('~/.ssh/id_rsa_api')
id_cmd = "ssh -i " + id_file
repo = Repo(path)
with repo.git.custom_environment(GIT_SSH_COMMAND=id_cmd):
# rest of code here but it's had no effect - the commits always are pushed under my main GiitHub account, no matter what SSH key I use. |
Beta Was this translation helpful? Give feedback.
-
Did the GIT_SSH_COMMAND environment variable have an effect when running From the code I see here I would expect this to be picked up when interacting with remotes. |
Beta Was this translation helpful? Give feedback.
-
@jmkd3v wrote
|
Beta Was this translation helpful? Give feedback.
@jmkd3v wrote