-
-
Notifications
You must be signed in to change notification settings - Fork 954
-
I have a local repository that I've already cloned and I want to push changes to remote (GitHub) from a different account.
I've tried something like this:
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.
All reactions
@jmkd3v wrote
Update: I was able to solve this problem by deleting my GitHub credentials and then changing my email and username on the local level.
Replies: 2 comments 2 replies
-
Did the GIT_SSH_COMMAND environment variable have an effect when running git
on the command-line directly?
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.
All reactions
-
Odd - it does not apply in the command line either. Maybe I should remove my main account from Git and try again?
Beta Was this translation helpful? Give feedback.
All reactions
-
Update: I was able to solve this problem by deleting my GitHub credentials and then changing my email and username on the local level.
Beta Was this translation helpful? Give feedback.
All reactions
-
@jmkd3v wrote
Update: I was able to solve this problem by deleting my GitHub credentials and then changing my email and username on the local level.
Beta Was this translation helpful? Give feedback.