Create a new key 

Use the following command:

ssh-keygen -t rse -C "user2@user2.com"

Be careful that you don’t overwrite your existing key for your personal account. Instead, when prompted, save the file as id_rsa_user2.


Add these new keys with ssh-add command:

ssh-add ~/.ssh/id_rsa_user1
ssh-add ~/.ssh/id_rsa_user2

Modify the SSH config:

 Create a config file:

cd ~/.ssh/
touch config

 

Add the following data:

Host git.assembla.com
 HostName git.assembla.com
 User Git
 IdentityFile ~/.ssh/user1
Host git.assembla-user2
 HostName git.assembla.com
 User Git
 IdentityFile ~/.ssh/user2

Configure Git for a new global username:

git config --global user.name "user2"
git config --global user.email "user2@user2.com"


Example:

git config --global gshabbir
git config --global gulam@assembla.com

Push your files using a normal Git flow.

You're done!


Have questions? Email us at support@assembla.com

Did this answer your question?