Skip to content

Instantly share code, notes, and snippets.

@XdoctorwhoZ
Created October 11, 2022 08:51
Show Gist options
  • Save XdoctorwhoZ/b6f5d8f84c58afb8d7804747c93f099a to your computer and use it in GitHub Desktop.
Save XdoctorwhoZ/b6f5d8f84c58afb8d7804747c93f099a to your computer and use it in GitHub Desktop.
# ~/.gitconfig
 
[includeIf “gitdir:~/personal/”] # include for all .git projects under personnal/ 
path = ~/personal/.gitconfig-pers
 
[includeIf “gitdir:~/work/”]
path = ~/work/.gitconfig-work


# ~/personal/.gitconfig.pers
 
[user]
email = your_pers_email@example.com
name = Your Name
 
[github]
user = “mynickname”
 
[core]
sshCommand = “ssh -i ~/.ssh/<personal_key>”

# ~/work/.gitconfig.work
 
[user]
email = your_pro_email@google.com
name = Your Name
 
[github]
user = “pro_name”
 
[core]
sshCommand = “ssh -i ~/.ssh/<professional_key>”
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment