Skip to content

Instantly share code, notes, and snippets.

@araphiel
Last active July 24, 2023 17:06
Show Gist options
  • 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 = [email protected]
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 = [email protected]
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