Let's suppose you have a personal git account and you don't want use it for professional purpose, how could you work with both handily?
So, you should have two ssh keys in your folder
your personal key and
id_rsa_pro your professional key. We will change the
ssh configuration in order to use your professional account.
# My professional account Host github-pro HostName github.com User git IdentityFile ~/.ssh/id_rsa_pro
Hence, when cloning a repository, instead of using
git clone firstname.lastname@example.org:MyCompany/Project.git, you will clone this way:
git clone github-pro:MyCompany/Repository.git
If you have already cloned your project, you can change the remote:
git remote set-url origin github-pro:MyCompany/Repository.git
Finally, for each pro repository, you'll have to change locally your email and username:
cd /pro/repository git config user.name "ProName" git config user.email "ProEmail"