I am trying since more than 3 hours to setting up multiple account for github and litteraly tired. I have tried out almost all possible way describe here, github and article
I am using this script, that switch indentity and other all neccessary like git setting
https://gist.github.com/milosjanda/a86ebc039293f22fabe723024ec42b46
if [[ -f ~/.ssh/.work ]]; then
echo "swith to HOME"
# mv ~/.ssh/id_rsa ~/.ssh/work; mv ~/.ssh/home ~/.ssh/id_rsa
rm ~/.ssh 2> /dev/null
ln -s ~/.ssh-work/home ~/.ssh
git config --global user.email "my.name@gmail.com"
else
echo "swith to WORK"
# mv ~/.ssh/id_rsa ~/.ssh/home; mv ~/.ssh/work ~/.ssh/id_rsa
rm ~/.ssh 2> /dev/null
ln -s ~/.ssh-work/work ~/.ssh
git config --global user.email "my.name@company.eu"
fi
# Delete all identities from ssh-agent
ssh-add -D
# Add new identity to ssh-agent
ssh-add