Last active
May 22, 2025 19:44
-
-
Save Tholkappiar/7065da630843eddc48c66d8966a80103 to your computer and use it in GitHub Desktop.
gitconfig
This file contains hidden or 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
### create ssh keys on names - pers and work and add to the github | |
config in .ssh dir | |
Host pers | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/pers ### private key | |
IdentitiesOnly yes | |
Host work | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/work ### private key | |
IdentitiesOnly yes | |
.gitconfig | |
[includeIf "gitdir:~/Developer/work/"] | |
path = ./.workconfig | |
[includeIf "gitdir:~/Developer/pers/"] | |
path = ./.persconfig | |
[user] | |
email = email.com | |
name = name | |
.persconfig | |
[user] | |
name = pers_name | |
email = pers_mail.com | |
[core] | |
sshCommand = "ssh -i ~/.ssh/pers" ### private key | |
.workconfig | |
[user] | |
name = work_name | |
email = work_email.com | |
[core] | |
sshCommand = "ssh -i ~/.ssh/work" ### private key | |
### Test | |
ssh -T git@pers | |
ssh -T git@work |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment