/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently !
- Generate your SSH keys as per your git provider documentation.
 - Add each public SSH keys to your git providers acounts.
 - In your 
~/.ssh/config, set each ssh key for each repository as in this exemple:Host github.com HostName github.com User git IdentityFile ~/.ssh/github_private_key Host gitlab.com Hostname gitlab.com User git IdentityFile ~/.ssh/gitlab_private_key
 
/!\ Require git 2.13+ for conditionnal include support.
- In your 
~/.gitconfig, remove the [user] block and add the following (adapt this exemple to your needs) :[includeIf "gitdir:~/code/personal/"] path = .gitconfig-personal [includeIf "gitdir:~/code/professional/"] path = .gitconfig-professional
 - In your 
~/.gitconfig-personal, add your personnal user informations:[user] email = [email protected] # note we use the noreply github mail name = personal_username
 - In your ~/.gitconfig-professional, add your professional user informations:
[user] email = [email protected] name = professional_username
 - Done !
 - Now each repository will use custom user info depending on the top-level folder.