[user]
name = personal_name
email = personal_email@google.com
[includeIf "gitdir:~/workspace/work/"]
path = ~/.gitconfig-work
[user]
name = work_name
email = work_email@company.com
# for github organization
[url "git@github.company.com:"]
insteadOf = https://git.521000.bestpany.com/
# for github organization
Host github.company.com
HostName github.company.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/work_ssh_key
You can now clone your work repositories to the ~/workspace/work/ directory via SSH.