- Generate two keys
- Create ~/.ssh/config
- Put following in it:
Host github.com-user1
HostName github.com
User git
IdentityFile ~/.ssh/[key file for user1]
Host github.com-user2
HostName github.com
User git
IdentityFile ~/.ssh/[key file for user2]
- Change git config for repos accordingly:
[remote "origin"]
url = [email protected]:[repo for user1]
fetch = +refs/heads/*:refs/remotes/origin/*
And same for repos for user2