Hi all, in this issue I want to share a tip to use multiple Github accounts on same computer.
A SSH key can be added to a single account. When you share same laptop to access both work or personal accounts, you will not be able to clone/push via SSH. In order to clone/push as other account, We need instruct Git to use other SSH key.
Create a file in
ssh -i $HOME/.ssh/[other-key] $1 $2
Whenever you want to switch to your personal git to clone/push, do this before run
If you use SSH Agent you may want to also do
ssh-add -D to remove the default SSH key from agent.
Hope it helps you :-). Now let get back to our links.