How to use multiple accounts

  1. Generate SSH Keys for both accounts

2. Add the SSH Public Key into the respective accounts

3. Set up configuration file ~/.ssh/config with both accounts

4. Clone using the alias for the Github Link

Note: You will have to change only github.com to the alias you have set up

Additionally, if you need to test which account connects where use the following commands:

Note: If you have set a different HOST parameter, you will have to use that one

As long as you have set up the SSH Keys correctly and the configuration file you should be able to clone the repositories successfully and the output should look like this:

Note: If you are still unable to clone the Repo this might be due to an account conflict due to an old account.

You might need to clear all accounts and not configure any of them

Check again account connectivity with:

5. After you have pulled the repository, you will need to add the following field to the ~/REPO_NAME/.git/config file

Should look something like this:

Last updated