- In ~/.ssh/ create a file called
config
with contents based on this:
#user1 account
Host github.aaakk.us.kg-user1
HostName github.com
User git
IdentityFile ~/.ssh/github-user1
#user2 account
Host github.aaakk.us.kg-user2
HostName github.com
User git
IdentityFile ~/.ssh/github-user2
git remote set-url origin [email protected]:user1/your-repo-name.git