Skip to content

Instantly share code, notes, and snippets.

@araphiel
Last active July 24, 2023 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save araphiel/0d85d848059dfb77bce39ad5167b0d7a to your computer and use it in GitHub Desktop.
Save araphiel/0d85d848059dfb77bce39ad5167b0d7a to your computer and use it in GitHub Desktop.
.gitconfig for multiple clients / organizations
# .gitconfig
[user]
name = Name
email = name@gmail.com
username = primary-github-username
signingKey = ~/.ssh/id_rsa.pub
[pull]
ff = only
[commit]
gpgsign = false
[core]
editor = code --wait
sshCommand = "ssh -i ~/.ssh/id_rsa.pub"
[gpg]
format = ssh
[gpg "ssh"]
allowedSignersFile = ~/.ssh/allowed_signers
## Client specific folders
[includeIf "gitdir:~/client-project/"]
path = ~/client-project/.gitconfig
# /client-project/.gitconfig
# Allows you to clone projects from another github account into the client-project folder
[user]
name = Example
email = name@example.com
username = secondary-github-username
signingKey = ~/.ssh/company_specific_ssh_key.pub
[pull]
ff = only
[commit]
gpgsign = true
[core]
editor = code --wait
sshCommand = "ssh -i ~/.ssh/company_specific_ssh_key.pub"
# ~/.ssh/config
Host example-org
HostName github.com
User git
IdentityFile ~/.ssh/company_specific_ssh_key
AddKeysToAgent yes
Host *
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment