- ssh-keygen -t rsa -C "[email protected]"
for example, 2 keys created at:
~/.ssh/id_rsa-j1g54w
~/.ssh/id_rsa-itmagix
then, add these two keys as following
$ ssh-add ~/.ssh/id_rsa-j1g54w
$ ssh-add ~/.ssh/id_rsa-itmagix
you can delete all cached keys before
$ ssh-add -D
finally, you can check your saved keys
$ ssh-add -l
$ cd ~/.ssh/
$ touch config
$ subl -a config
Then added
#j1g54w account
Host github.com-j1g54w
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa-j1g54w
#itmagix account
Host github.com-itmagix
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa-itmagix
clone your repo
cd and modify git config
$ git config user.name "j1g54w"
$ git config user.email "[email protected]"
$ git config user.name "itmagix"
$ git config user.email "[email protected]"
or you can have global git config
$ git config --global user.name "j1g54w"
$ git config --global user.email "[email protected]"
then use normal flow to push your code
$ git add .
$ git commit -m "your comments"
$ git push