How to access multiple Github accounts on same machine (Without SSH)

How to access multiple Github accounts on same machine (Without SSH)

Sometime we need to access two github accounts from the same machine and it creates problem when pushing code as another user to the another account. The things can be made simpler. You event don't need to do SSH configuration. Because I know for windows users the ssh configuraion is complicated. But if your only purpose is to access the another github account from the same machine then this method is the best.

First of all check the global or default github account saved in your computer. you can run below command in command line to see it.

git config --list

  1. open the Credential manager

  2. Go to windows credentials and find the github sessions saved here

  1. Delete the existing saved username and password

  1. Now we will change the default user saved in the github configuration

    run below command in the command line/bash to configure new github account

git config --global "your Github ID"
git config --global <email used in github>

Now to check the default user it will be changed. Now you are good to go.

  1. Clone or push the code

    Now, Whenever you want to push the code to another github repository then this will github will ask to authenticate using ID and password then you can easily access the another github account.

Now suppose you want to user previous github account then you can repeat this small process again. This is good method if you use annother github account temporarily in addition to your main account. Still, you can use the SSH way of doing it, but it is for those who do not want to mess anything more.

I hope you enjoyed this.
Thank You