Last active
July 24, 2023 17:06
-
-
Save araphiel/0d85d848059dfb77bce39ad5167b0d7a to your computer and use it in GitHub Desktop.
.gitconfig for multiple clients / organizations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.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