Use TortoiseGit with multiple GitLab accounts

2019-05-30 20:34发布

问题:

I have two GitLab account and want to use them with TortoiseGit so for that I made keys and add them to each account so no I have to key in .ssh folder like id_rsa_account1 and id_rsa_account2.
Also I changed config file like here and now I dont have problem in using git with cmd but I want to use it with TortoiseGit.

Now how can I have two repository like test1 and test2 and use them with TortoiseGit?

回答1:

How to set up two SSH keys for two GitLab accounts and push/pull by using TortoiseGit? only works if you use OpenSSH.

For using putty plink (which is the default in TortoiseGit) you need to create an alias in putty. You can find an answer here: https://stackoverflow.com/a/29183147/3906760

You can also make TortoiseGit use Openssh by setting the ssh client to "ssh" in TortoiseGit network settings.



回答2:

I have written an answer 'how to have multiple accounts with TortoiseGit with different username/password method (not with rsa keys). If you are interested in that method, then checkout the answer here https://stackoverflow.com/a/49468061/4036462