Create different ssh key according the article See to Generating SSH keys.
$ ssh-keygen -t rsa -C "your_email@youremail.com" -f id_rsa_workOr:
$ ssh-keygen -t rsa -C "your_email@youremail.com" -f id_rsa_personalFor example, 2 keys created at:
~/.ssh/id_rsa_work
~/.ssh/id_rsa_personal
```bash
Then, add these two keys as following:
```bash
$ ssh-add ~/.ssh/id_rsa_work
$ ssh-add ~/.ssh/id_rsa_personal
```bash
You can delete all cached keys before:
```bash
$ ssh-add -DFinally, you can check your saved keys:
$ ssh-add -lOpen ~/.ssh/config file:
$ cd ~/.ssh/
$ touch config
$ vim config # please use your favorite editorThen added something like:
# work account
Host github.com-work
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_work
# personal account
Host github.com-personal
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_personal
clone your repo (note "github.com-personal")
git clone git@github.com-personal:work/repo.git repo_personal
cd repo_personal and modify git config
$ git config user.name "personal"
$ git config user.email "personal@gmail.com"
or
$ git config user.name "work"
$ git config user.email "work@gmail.com"
then use normal flow to push your code
$ git add .
$ git commit -m "your comments"
$ git push